Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.databases.filemaker > #1542
| From | Helpful Harry <HelpfulHarry@BusyWorking.com> |
|---|---|
| Newsgroups | comp.databases.filemaker |
| Subject | Re: Using Variables in Find Requests |
| Date | 2013-11-27 18:50 +1300 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <271120131850081927%HelpfulHarry@BusyWorking.com> (permalink) |
| References | <0001HW.CEBA50E9028DAA5BB02919BF@news.astraweb.com> |
In article <0001HW.CEBA50E9028DAA5BB02919BF@news.astraweb.com>, Nelson
<nelson@nowhere.com> wrote:
> I am trying to write a script to find records between two dates, say
> 1/1/2013 and 2/1/2013. The fields which specify the two dates are in a
> different table from the records I am trying to search so I am using
> variables in the script to save the values while I change to to the
> table/layout that contains the target records.
>
> First, I set $Start to 1/1/2013 and $End to 2/1/2013 and then switch to
> the target layout and enter $Startä$End in the date field of the find
> request script step. When I try to execute the find, I get an invalid
> field error. Using the script debugger I can see that the date field
> contains the sting "$Startä$End" instead of "1/1/2013ä2/1/2013". The
> same thing happens with ">$Start" in the request field. Curiously,
> however simply entering $Start in the request field works.
>
> Here is the script:
>
> Set Variable[$Start;Value:Billing Periods::Start Date]
> Set Variable[$End;Value:Billing Periods::End Date]
> Go to Layout["Combined Call Log" (Call Log)]
> Enter Find Mode[Restore]
> (Note: "Date" Request field set to $Startä$End)
> Perform Find[]
>
>
> Is this a known bug or am I missing something?
>
> Thanks.
I see from later messages that you've solved the problem, but just as
an aside ...
Since you're scripting the find, I would personally not use the Restore
option for the Enter Find Mode command. Instead, get the Script to
enter the required Find data into the field itself. This makes it
easier to see what the Script does (if you come back months / years
late, for example) and to make it easier to alter in the future.
(Note: Since I have never used variables, I'm not sure of the format
for using them in the Set Field command)
e.g.
Set Variable[$Start;Value:Billing Periods::Start Date]
Set Variable[$End;Value:Billing Periods::End Date]
Go to Layout["Combined Call Log" (Call Log)]
Enter Find Mode[]
Set Field [Date; $Start & "..." & $End]
Perform Find[]
Depending on what data type is in the variables, you may need to also
play around with changing the data format:
e.g.
Set Field [Date; DateToText($Start) & "..." & DateToText($End)]
Helpful Harry :o)
Back to comp.databases.filemaker | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Using Variables in Find Requests Nelson <nelson@nowhere.com> - 2013-11-26 13:21 -0500
Re: Using Variables in Find Requests clkaufmann@gmx.ch (Christoph Kaufmann) - 2013-11-26 20:35 +0100
Re: Using Variables in Find Requests Howard - FM Pro Solutions <fmprosolutions@gmail.com> - 2013-11-26 12:50 -0800
Re: Using Variables in Find Requests Nelson <nelson@nowhere.com> - 2013-11-26 17:05 -0500
Re: Using Variables in Find Requests Howard Schlossberg <howard@nospam.fmprosolutions.com> - 2013-11-26 20:15 -0800
Re: Using Variables in Find Requests Helpful Harry <HelpfulHarry@BusyWorking.com> - 2013-11-27 18:50 +1300
Re: Using Variables in Find Requests Nelson <nelson@nowhere.com> - 2013-11-27 06:26 -0500
csiph-web