Newbies Icechip Posted May 13, 2011 Newbies Posted May 13, 2011 So made a find button On entering the button, Enters Find Mode: Enter specific Find: omit records: Critera: would like to omit any records 60 days older than todays date: So omit records:// ...lost now. i know its something simple Made 2 new field Current_Date & Find_30 Script name: Customer_Report Enter Find mode[pause] perform find[] insert current date[select;job ticket::current_date] Insert calculated result[select;job ticket::Find_30;job ticket::jobdue - job ticket::current_date] Constrain Found set[restore] Find Records jobticket::Find-30[>30]
LaRetta Posted May 13, 2011 Posted May 13, 2011 Critera: would like to omit any records 60 days older than todays date: So omit records: Made 2 new field Current_Date & Find_30 You do not need these two new fields because you can specify the criteria right within your find script, icechip, so let's review your script: Script name: Customer_Report Enter Find mode[pause] Set Error Capture [ On ] ... important to trap for no records found or errors perform find[] If [ Get ( LastError ) // error or no records found ] Show Custom Dialog [ OK ; "No records found."] ... do whatever you wish because there were no records Exit Script End If ... records found so proceed ... ... I assume you begin with this find so Users can specify different criteria and then you want to constrain to within 60 days of current date? insert current date[select;job ticket::current_date] Insert calculated result[select;job ticket::Find_30;job ticket::jobdue - job ticket::current_date] Constrain Found set[restore] Find Records jobticket::Find-30[>30] ... this won't work because Find Requests only handle static data and not calculations (unless you place them first in variable and that is not required here anyway) Enter Find Mode [ uncheck pause ] Set Field [ Job ticket::JobDue ; ">" & Get ( CurrentDate ) - 60 ] Constrain Found Set [ ] I believe that FM uses just as much resource/time to find records which DO meet find criteria as it does to find records which don't. Is this getting you closer to what you need? :)
Newbies Icechip Posted May 17, 2011 Author Newbies Posted May 17, 2011 it seems to be much simpler , until i reach this line Set Field [ Job ticket::JobDue ; ">" & Get ( CurrentDate ) - 60 ] states that /*-+ is expected? You do not need these two new fields because you can specify the criteria right within your find script, icechip, so let's review your script: Script name: Customer_Report Enter Find mode[pause] Set Error Capture [ On ] ... important to trap for no records found or errors perform find[] If [ Get ( LastError ) // error or no records found ] Show Custom Dialog [ OK ; "No records found."] ... do whatever you wish because there were no records Exit Script End If ... records found so proceed ... ... I assume you begin with this find so Users can specify different criteria and then you want to constrain to within 60 days of current date? insert current date[select;job ticket::current_date] Insert calculated result[select;job ticket::Find_30;job ticket::jobdue - job ticket::current_date] Constrain Found set[restore] Find Records jobticket::Find-30[>30] ... this won't work because Find Requests only handle static data and not calculations (unless you place them first in variable and that is not required here anyway) Enter Find Mode [ uncheck pause ] Set Field [ Job ticket::JobDue ; ">" & Get ( CurrentDate ) - 60 ] Constrain Found Set [ ] I believe that FM uses just as much resource/time to find records which DO meet find criteria as it does to find records which don't. Is this getting you closer to what you need?
LaRetta Posted May 17, 2011 Posted May 17, 2011 it seems to be much simpler , until i reach this line Set Field [ Job ticket::JobDue ; ">" & Get ( CurrentDate ) - 60 ] states that /*-+ is expected? There are two parts to the Set Field[] script step: 1) Specify Target Field - this is where you select the field you wish to set, which in this case is the portion in blue above. 2) The Calculated result - this is where you type the calculation you want to use, which in this case is the red above. These two parts are separated by a semicolon (in black). What you did was skip 1 and enter the entire portion into 2 which will produce the exact error you received. So instead, select your field in 1 and enter ONLY the red in the calculation box in 2.
Recommended Posts
This topic is 4937 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now