April 8, 200322 yr Can someone let me know how you can instruct a Script to set the field value for a Perform Find within two global dates? In the SetField script step I can't seem to enter for instance g_last_date...g_first_date Thanks in advance.
April 8, 200322 yr You can't use Set Field to enter the result you need for this. Set Field requires the output to be in the format of the destination field. Use Insert Calculated Result instead. Your script would be: Enter Find Mode [] Insert Calculated result[DateField,DateToText(g_First_Date) & "..." & DateToText(g_Last_Date)] Perform Find []
April 8, 200322 yr Author Thanks, Russ! Just before checking back on the forum to see your post I had consulted a reference book on FMP and come across the Insert Calculated Result script step, but hadn't understood the point about converting Dates to Text within the calculation. Everything works just fine now! Thanks again!
April 9, 200322 yr But Insert calculated result does have the limitation that you need to be on the layout with the fileds in quesiton otherwise when you run the script nothing is entered into this field. When dealing with any ranges I strongly recommend use of a plug in or the take the time and add this into your solution, it is worth the effort. http://www.onegasoft.com/tools/smartranges/index.shtml
April 9, 200322 yr Author Thanks, Ocean. The article you recommend looks like interesting reading. Will definitely consider it. Respectfully, Alex.
April 9, 200322 yr Your original script may be faulty. It should read: SetField(SearchField, g_first_date & "..." & g_last_date There are two possible problems -- one is not putting the ellipsis (those three dots) in parentheses, and the other is putting the last date before the first (unless that's a typo).
Create an account or sign in to comment