Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with Script Halting

Status
Not open for further replies.

machtenx

IS-IT--Management
Dec 2, 2003
54
US
I designed a script to generate a report for the current month to export to a file which would later be imported to excel

I've designed successfully most of the script, but when it comes to the point for Exporting the script, nothing happens. It finds the results for the month, and t hen does not Export, no dialog or error message is given; it just doesn't happen.

Here is my script
Enter Find Mode
Insert Text [Select, "production_date", ">"]
Insert Calculated Result ["production_date", "Month(Today)"]
Insert Text ["production_date", "/1/"]
Insert Calculated Result ["production_date", "Year(Today)"]
Export Records [Restore, "Monthly Report"]
 
You haven't included a 'Perform Find' step. Was that an oversight in your post or in your script?
I presume you do know to do the export manually before writing your script (or use the 'Replace' after writing it.)

Cheers,
Paul J.
 
Thanks for your response, Paul. The lack of a 'Perform Find' step was by design to allow the user to change the date to search for if necessary. However I figured maybe I needed this step so I added the 'Perform Find' step to the script so it reads as this:

Enter Find Mode
Insert Text [Select, "production_date", ">"]
Insert Calculated Result "production_date", "Month(Today)"
Insert Text "production_date", "/1/"
Insert Calculated Result "production_date", "Year(Today)"
Perform Find []
Export Records [Restore, "Monthly Report"]

The Script works the same as it previously did, minus the ability to change the date. However it still will not start up the Export function :( :( It just finds the records and sits there with them.

I don't understand why it won't export. Is there some step I have to do to prepare it for export? Any more help would be very much appreciated. Gotta finish this sucker

Thanks,
Matt
 
Ahhhh it works!!! I'm glad it works now but can you think of any way that would allow the user to change the month to search for if they needed to?
 
I guess my basic question now is what is the best way to tell Filemaker to search for all dates falling on a specific months???
 
You can use the "show custom dialog" script step to ask the user if they want this month or another month.

Place this step after the insert calc result step for your month field, add the month field to the custom dialog and they will see this month when the dialog displays and have the option to change it.

Phil
 
If you are just searching for dates in the current month, which is what your find does, why not just use a calculation field (Month(today) or Monthname(today))?
You need to be careful letting users change Find values in a script. They could enter invalid dates, or just mess up valid dates. If you opt for a Dialogue box, get them to enter three fields - Day (of month), Month (number) and Year. You can initialise the (global) filed values for the Dialogue before asking the user to confirm/chanhe them. Then you can check that they've not entered crook numbers and use the global values to set up your find in 'production date'.

Cheers,
Paul J.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top