Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Using a variable field to constrain a find

Posted on 2011-02-15
6
Medium Priority
?
1,153 Views
Last Modified: 2012-05-11
I am trying to constrain a found set by selecting an employee name from a new window. I use one script Test_Open to open the window, Test_Close to close the window, Test_Find to constrain the found set, and finally Test_Print to print the report. I have tried multiple approaches but have been unable to constrain the found set with the variable field. The scripts are shown below. Any help would be greatly appreciated. Thanks.

Test_Open

Allow User Abort [ Off ]
New Window [ Name: "Specify Account Executive"; Height: 400; Width: 650; Top: 220; Left: 285 ]
Go to Layout [ “FS_Snavely_AE_Report_Active” (FS_CONTACTS) ]
Go to Portal Row
[ Select; First ]
Show/Hide Status Area
[ Lock; Hide ]
Set Zoom Level
[ Lock; 100% ]
Pause/Resume Script [ Indefinitely ]

Test_Close

Set Variable [ $A_E; Value:"\"" & FS_Employees::Employee_Name & "\"" ]
Close Window [ Current Window ]
Perform Script [ “Test_Print” ]
Halt Script
Exit Script [ ]

Test_Find

Set Error Capture [ On ]
Set Field [ COMPONENTS::$A_E; $A_E ]
Enter Find Mode [ ]
Perform Find [ Specified Find Requests: Find Records; Criteria: COMPONENTS::Project_Status: “=Active” ]
[ Restore ]
Constrain Found Set [ Specified Find Requests: Find Records; Criteria: COMPONENTS::Design: “=Yes” ]
[ Restore ]
Constrain Found Set [ Specified Find Requests: Find Records; Criteria: COMPONENTS::Project_Component_Type: “="Print:"” ]
[ Restore ]
Sort Records [ Specified Sort Order: PROJECTS::Client_Name_and_Contact; ascending
COMPONENTS::Project_Component_Number; ascending
COMPONENTS::Project_Component_ID; ascending ]
[ Restore; No dialog ]
Set Error Capture [ Off ]
Exit Script [ Result: Get ( FoundCount ) ]

Test_Print

Allow User Abort [ Off ]
Perform Script [ “Test_Find” ]
If [ Get ( ScriptResult ) > 0 ]
New Window [ Name: "Print Preview"; Height: 650; Width: 809; Top: 120; Left: 30 ]
Go to Layout [ “R_Print_Concept_Development” (COMPONENTS) ]
Show/Hide Status Area
[ Lock; Toggle ]
Set Zoom Level
[ Lock; 100% ]
Print Setup [ Orientation: Landscape; Paper size: 8.5" x 11" ]
[ Restore; No dialog ]
Print [ Records being browsed; All Pages; Orientation: Portrait; Paper size: 8.5" x 11" ]
[ Restore: HP LaserJet 5100 ]
Close Window [ Name: "Print Preview"; Current file ]
Exit Script [ ]
Else
Show Custom Dialog [ Title: "No Records Found"; Message: "No records were found that match this search request. Select OK to return to Reports."; Buttons: “OK” ]
End If

Again, many thanks for any help with this issue.
0
Comment
Question by:jlsnavely
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 4

Accepted Solution

by:
challengeday earned 1000 total points
ID: 34899196
Hi ilsnavely,

This is your key step: Set Variable [ $A_E; Value:"\"" & FS_Employees::Employee_Name & "\"" ]

I see two problems with it:

To use a variable from one script to the other, make sure you use $$ in front to make it a global variable (otherwise it's local and it is only available to that script), so name it $$A_E and make sure all references everywhere else are also changed to $$A_E

Also, you are specifying the field as a text constant and that doesn't give you the value of the field. In the Set Variable dialog, click specify for value and then pick the table and field you want, but don't put quotes around it.

The end result should look like this:
Set Variable [ $$A_E; Value:FS_Employees::Employee_Name]

0
 
LVL 6

Assisted Solution

by:ThomDroz
ThomDroz earned 1000 total points
ID: 34900521
jlsnavely

I agree with the above about using the "$$".  
Another approach is to set that variable value to a global field so that it can be pulled from that filed later for use and dosent leave the $$varibale floating around.

I am also not clear on why you are adding the "\" after the name
0
 

Author Comment

by:jlsnavely
ID: 34934076
Thank you, challengeday and ThomDroz, you put me on the right path: Here is my solution that works...

Open Window

Allow User Abort [ Off ]
New Window [ Name: "Specify Account Executive"; Height: 400; Width: 650; Top: 220; Left: 285 ]
Go to Layout [ “FS_Snavely_AE_Report_Active_Print_Concept” (FS_CONTACTS) ]
Go to Portal Row [ Select; First ]
Show/Hide Status Area [ Lock; Hide ]
Set Zoom Level [ Lock; 100% ]


Close Window

Allow User Abort [ Off ]
New Window [ Name: "Specify Account Executive"; Height: 400; Width: 650; Top: 220; Left: 285 ]
Go to Layout [ “FS_Snavely_AE_Report_Active_Print_Concept” (FS_CONTACTS) ]
Go to Portal Row [ Select; First ]
Show/Hide Status Area [ Lock; Hide ]
Set Zoom Level [ Lock; 100% ]

Find

Set Error Capture [ On ]
Perform Find [ ]
Constrain Found Set [ Specified Find Requests: Find Records; Criteria: COMPONENTS::Project_Status: “=Active” ] [ Restore ]
Constrain Found Set [ Specified Find Requests: Find Records; Criteria: COMPONENTS::Design: “=Yes” ] [ Restore ]
Constrain Found Set [ Specified Find Requests: Find Records; Criteria: COMPONENTS::Project_Component_Type: “="Print:"” ] [ Restore ]
Set Error Capture [ Off ]
Exit Script [ Result: Get ( FoundCount ) ]

Print

Allow User Abort [ Off ]
Perform Script [ “Find_Active_Print_Concept_A_E” ]
If [ Get ( ScriptResult ) > 0 ]
New Window [ Name: "Print Preview"; Height: 650; Width: 809; Top: 120; Left: 30 ]
Go to Layout [ “R_Print_Concept_Development” (COMPONENTS) ]
Show/Hide Status Area [ Lock; Toggle ]
Set Zoom Level [ Lock; 100% ]
Print Setup [ Orientation: Landscape; Paper size: 8.5" x 11" ] [ Restore; No dialog ]
Print [ Records being browsed; All Pages; Orientation: Portrait; Paper size: 8.5" x 11" ] [ Restore: HP LaserJet 5100 ]
Close Window [ Name: "Print Preview"; Current file ]
Exit Script [ ]
Else
Show Custom Dialog [ Title: "No Records Found"; Message: "No records were found that match this search request. Select OK to return to Reports."; Buttons: “OK” ]
End If

Thanks again... and I did this without having to use a "$$"


0
 

Author Comment

by:jlsnavely
ID: 35334305
ok
0
 
LVL 8

Expert Comment

by:Tocacar
ID: 35364709
This question has been classified as abandoned and is being closed as part of the Cleanup Program. See my comment at the end of the question for more details.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Conversion Steps for merging and consolidating separate Filemaker files The following is a step-by-step guide for the process of consolidating two or more FileMaker files (version 7 and later) into a single file with multiple tables. Sometimes th…
Having just upgraded from Filemaker 11 to Filemaker 12 over the weekend, we thought we would add some tips for others making the same move.  In general, our installation went without incident. Please note that this is not a replacement for Chapter 5…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question