A classic approach used in FileMaker Pro that should also work for GO is to define a series of global fields for each of the items above, then click a button to perform a script that uses the data entered into the global fields to perform a find to locate and display the desired records. Each global field can be formatted with value lists and other features to assist the user in selecting criteria for the find.
Here's sample script that just uses a date range and a selected "office" value. (add more steps to include the other criteria you specify.)
Go To Layout [//select layout designed to display your data in report format]
Enter Find Mode
Set Field [YourTable::DateField ; YourTable::gDate1 & "..." & YourTable::gDate2 ]
Set Field [YourTable::Office ; If ( YourTable::gOffice = "All" ; "" ; YourTable::gOffice ) ]
Set Error Capture [on]
Sort[Restore] // may or may not be needed, depending on design of report layout
Each of the fields whose name starts with a 'g' must be defined as fields with global storage in order for this script to work.
Is there a way I can have the report also as a variable? Currently I have a script that determines the layout based on the script parameter after "Run Report".
If [$Report = "Pending Jobs"]
Go to Layout ["Outstanding Jobs" (Contracts)]
Perform Script ["Set Page Layout Landscape"]
Sort Records [Restore; No dialog;]
Set Field [$ReportTitle; "Pending Jobs Report"]
So do you see a reason I cannot incorporate the above in the script, always thinking towards iPad functionality?
Many thanks for your help.
As long as the layouts specified in the variable all refer to layouts upon which the find can be performed successfully, there should be no problem.
Example: if I assume that your pending jobs report uses a layout that refers to a Table Occurrence called "Jobs" in layout setup..., then I can write the find script to perform the search by entering data into fields in "jobs" and any records related to "jobs". If I specify a layout that refers to "contacts" in layout setup, this won't work as the find will fail. Even a layout that refers to "Jobs 2" or some other Table Occurrence that refers to the same data-source table may not work as expected.
Note: a "Table Occurrence" is one of the boxes found in Manage | Database | Fields. These "boxes" control what data may be displayed, manipulated from a given layout based on which one is specified in "Show Records From" in Layout Setup...