Jump to content

Record load causes endless loop


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

Recommended Posts

FM 12 Adv. I'm trying to use a layout trigger on record load. The script goes to related records on another layout to perform some operations and then returns to the layout. So, when I load a record, the script triggers, goes to another layout, returns to the original layout, and the script fires again. An endless loop! Any suggestions on how I can get around this?

Link to comment
Share on other sites

At the beginning of the script, check for $$flag being set to 1; if it is,  then set it to 0 and exit script. While on the second layout, set $$flag to 1.

Link to comment
Share on other sites

38 minutes ago, john9210 said:

The script goes to related records on another layout to perform some operations and then returns to the layout.

You could add the 'Show in new window' option to the GTRR step and close the window when done.

Link to comment
Share on other sites

A solution example is attached. On the Meeting layout a trigger on the Response field runs the script "Count responses". It updates the data in the box under Response Summary. The button beneath the Summary also updates the data. I need to use the button when changing records because the summary data does not automatically update. I would like to run the script when I change records and I thought that attaching a layout trigger on Record load would do the trick. However, this creates a endless loop because the script changes layouts and returns to the original layout firing the script again. I've tried the "Show in new window" and the "$$Flag" suggestions, but neither works. Is what I'm trying to do possible?

Link to comment
Share on other sites

You do not need script triggers or script to count records. You need script trigger to commit record and refresh the screen and you also need 4 Summary Fields.  

Example.fmp12

Edited by schamblee
Link to comment
Share on other sites

This topic is 2824 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.