Layout Script Trigger

Is there a Script Trigger to do something when you first load a layout? I saw a reference to an "OnLayoutLoad" on an old (2010) Claris Community post. Is this something that has disappeared in the many updates since then?

As a layout is first opened, I want to check to see if some JSON data is available and if it isn't call the script to create it.

Thanks!

See New Script Triggers in FileMaker Pro 11 and other Behavioral Changes (claris.com)

Extract

NOTE: The name of OnLayoutLoad has been changed to OnLayoutEnter in FileMaker Pro 11 to match the OnLayoutExit trigger that has been added.

Absolutely there is an OnLayoutEnter and a complementary OnLayoutExit.

We continue to be totally frustrated by the missing pair to the OnRecordLoad, which should be the OnRecordUnload or OnRecordExit. This missing layout script trigger results in many, many hours of work writing get arounds as we continue to abandon many of FileMaker’s legacy features to optimise it for use over the Internet.

If anyone else feels the same way, do please vote for this here:
https://community.claris.com/en/s/idea/0870H000000fyrGQAQ/detail

Unfortunately over the years there have been a number of these idea postings, so some of the voting has been diluted across these, but this one seems to now have the most traction

5 Likes

I've just visited the claris forum to ensure that idea gets my vote. I remember questioning whether there was a need for this trigger at the time you first raised the idea. Back then I thought it was possible to get by without it. Now I just want it.

Thanks for this Malcolm

I’ve had a number of people question why we would want it, and often it is difficult to explain to developers who don’t follow our pattern of avoiding the use of field level validation, avoiding cross table calculations where possible and putting all the logic into scripts, mostly run by script triggers. All of which removes structural overheads and dramatically improves performance over lower bandwidth connections.

The inability to run these before leaving a record always ends up in a time consuming, less efficient compromise.

Kindest regards
Andy

3 Likes

Just voted for this as well

2 Likes

Thanks for all the responses!!

The problem was, as I like to put it, between the keyboard and the chair. My script was calling for another layout to be opened, and FM was putting that layout on top of the original. The second layout was opened previously, so it looked like the layout was just changing. I have set up the line to open up the second layout so that the layout is opened off-screen.

Thanks again!!