September 5, 200916 yr I wrote a script in FM9 that generates a report, narrowing information by user specified date range. Enter Find Mode Go to Field (orderdate) Set Field (orderdate) to DateRange Set Error Capture On Perform Find. Worked great in FM9, doesn't work in FM10. Seems to be a problem with setting the field to the DateRange, which is a calculated field based on a start date and an end date. The calculation results in a field value that is something like 1/1/2008...1/31/2008. Works if I manually enter it in while in Find mode, but FM10 seems to dislike that format when trying to enter it in to a date field. Any ideas on how to get around this? Thank you in advance for any information you may be able to provide.
September 5, 200916 yr How is the user specifying the date range? Are they entering Start Date and End Date into global fields? Why not just take them to Find Mode and Pause? Do you know that you can Find for all January 2008 records by entering 1/*/1998 in Find mode? You do not need to Go to Field before using Set Field, btw.
September 5, 200916 yr Do you know that you can Find for all January 2008 records by entering 1/*/1998 in Find mode? No, I don't.
September 5, 200916 yr Duh, for 2008, you'd enter 2008. Comment, please, I'm old and haven't adjusted yet to the century change, lol.
September 6, 200916 yr That wasn't my main point. http://www.youtube.com/watch?v=QLILrC7Y5L4&feature=fvst
September 6, 200916 yr Author Date range is specified by entering a start and end date in to global fields. I usually do not need just one month, but rather a range of months, depending on the report that is being run. I don't see any purpose in pausing the script, if I can have it do everything it used to do under FM9. And for a user it's easier for them to enter start and end dates, rather than enter find mode, enter a formatted date range, find the results, and then run a script to format the report.
September 6, 200916 yr I am not aware of anything new in version 10 that should affect your script. However, you did not tell us anything about how DateRange is calculated, and the description of the problem is rather vague. I suggest you put a pause in the script right before Perform Find, and examine the actual criteria in the orderdate field.
September 6, 200916 yr If all you need is to Find on a date range, then you're right, why put the user in a Find layout, paused, with a button that Resumes and continues on to the report. But, as Comment says, it's not apparent how you calc DateRange. You need to examine what you have in the OrderDate field when you are in Find. A debug Pause or Modify Last Find will offer a clue.
September 6, 200916 yr Author DateRange is a calculation. = DateStart & "..." & DateEnd. Unstored text--the calculation doesn't work if it's set to result in a date. For testing, I paused the script, entered a date range "1/1/2009...6/30/2009" and it worked. But if I don't pause the script, there is no value set in the OrderDate field.
September 6, 200916 yr Author Problem solved. Thanks for pointing me in the right direction. Setting the OrderDate field to the value the calculation in the set field step, instead of setting it to a global field that is based on the calculation, allows the script to function correctly. Thank you very much!
September 7, 200916 yr "a global field that is based on the calculation," wonder what you mean by this.... All you need is two globals: gStartDate and gEndDate. Then a script: Enter Find Mode Set Field OrderDate, gStartDate & ".." & gEndDate Perform Find You never needed DateRange.
Create an account or sign in to comment