Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 5557 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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.

Posted

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.

Posted

Duh, for 2008, you'd enter 2008. Comment, please, I'm old and haven't adjusted yet to the century change, lol.

Posted

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.

Posted

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.

Posted

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.

Posted

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.

Posted

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!

Posted

"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.

This topic is 5557 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.