In article
<e0a197e2-6181-4243-a967-c8b4c3a7c513 (AT) u25g2000pra (DOT) googlegroups.com>,
Buckbuck <buck.matthew74 (AT) yahoo (DOT) com> wrote:
Quote:
FM8.5
I am trying to create a script that will select a specified group with
several parameters
These are:
Country is "Canada" or Ship to Country is "Canada"
and
The Create Date is greater than g_Comparative Date
and
The HST submitted value is not equal to "Yes"
Can anyone advise me here. When I do a Perform Find it is selecting
only fields that satisfy all conditions. |
Scripted Find are done the same way you do them manually.
In this case there are really three different Finds ("Or"), each of which
use a combination of Fields ("And"), plus the added "Not". For that you need
three Find Requests.
The "Not" Find might be able to be done as a "And", but it depends on the
possible data in the HST Field (e.g. instead of Not "Yes" you could use
And "No"). I'll stick with "Not" just in case there are other possible
values, including blank data.
Manually you would:
- enter Find Mode,
- type "Canada" into the Country Field
- type "> date" (where 'date' is an actual date) into the
Create Date Field
- create a new Find Request
- type "Canada" into the Ship to Country Field
- again "> date" into the Create Date Field
- create a third Find Request
- type / enter "Yes" into the HST Field
- click on the Omit option in the side Status Bar
- perform the Find
This process gives you the Script you need.
i.e.
Enter Find Mode []
Set Field [Country; "Canada"]
Set Field [Create Date Field; ">" & g_Comparative Date]
New Record / Request
Set Field [Ship to Country; "Canada"]
Set Field [Create Date Field; ">" & g_Comparative Date]
New Record / Request
Set Field [HST, "Yes"]
Omit Record
Perform Find []
Make sure that the two Find commands are not set to Pause and not set
to Restore saved Requests
Note:
There is a slight hiccup here. I'm not sure if they've fixed it in newer
versions of FileMaker, but in older version you cannot use the Set Field
command if working with Finds of dates and times that require the symbols
">", "<", "<>", "...", etc. In these cases you have to use a workaround with
the Insert Calculated Result command instead.
i.e.
replace
Set Field [Create Date Field; ">" & g_Comparative Date]
with
Insert Calculated Result [Create Date Field; ">"
& DateToText(g_Comparative Date)]
The DateToText function is now one of the Get functions in newer versions
of FileMaker.
Helpful Harry

)