make that: If [Not Utility::Already Run ]
For future reference:
- You can upload a screen shot by clicking the edit link to your original message and uploading it there
- You can upload a screen shot to a file share site and post the download link to a new response you post here.
- You can print a script to a PDF, open the PDF and then select and copy the script as text from the opened PDF.
- If You have FileMaker advanced, you can generate a database design report and copy the script as text from there.
It still doesn't seem to work, on 2nd time opening, the script still runs fully and deletes all records specified?
Ok, spotted the other fix you need. Use Go To Layout [original layout] to return to your original layout just before using Set Field to set the Already Run field to True.
Now it doesn't delete any of the records on 1st or 2nd time opening.
By [original layout] does it just have to be a layout that is related to the Utility table?
Gee, I am so sorry. I keep making stupid mistakes here. Yes, this should not be original layout, but rather the Utility table based layout.
check the utiltity table layout to be sure you have a record there
can you repost the script with changes?
That's the new screenshot up
What is on that original layout that you are deleting all the records
You missed the NOT in the IF [Utility::Already Run]
Can you tell me if there is a record with a value in already run on your utility layout?
The NOT is there in the script.
The solution is to be used with FmGo so I'm trying to limit the number of unnecessary redords, especially photos.
There is currently 1 record on the utility layout with the value as '1'
Do I perhaps need to delete this value/record at the end of the script?
If that's the new screen shot, I'm not seeing a go To layout to take you back to the utility layout before using Set Field to update the Already Run field.
There's a [Go To Layout "Utility::Utility] Script Step before the set field
Sorry, but I just scrolled up and checked and it's not there.
This is what I mean:
Go To layout [checkout photos]
Delete All Records [no dialog]
Go to Layout [Utility]
Set field [Utility::Already Run ; True ]