Layout Script Triggers Don't Work When Script Used

I have a script that reads a CSV, writes the value to a temp table, extracts that value into a variable, goes to the main layout, and updates the layout value. I also commit the value for good measure.

This method works fine except when there is a script trigger on the field I'm updating. When there is a script trigger on the field updated, the script trigger does not fire to update other fields on the layout.

So, how do I update a value on a field using a script when that field also has a script trigger on it (so that the script trigger fires as expected)?

I've tried both "OnObjectModify" and "OnObjectExit". Neither works.

Do I instead need to simulate a TAB character in the script to programmatically move the cursor from the field updated so the script trigger fires? I didn't see any examples of this idea, if it's how to proceed.

Would somebody suggest an approach?

Thanks in advance!

The Set Field script step will not fire the trigger. You can one of the "Insert" script steps, assuming your field is on the layout with the trigger on the field.

Alternatively, you can call the script with perform script after you are done setting the field. This is perhaps the more readable approach.

2 Likes

Field script triggers are interface features. Setting a field does not activate a layout object… so no interface feature fires with this script step. Your script needs to enter the layout field, modify the layout field (insert calculated result, for example) and then perhaps exit the layout field (depending on the trigger) for a layout field trigger to fire. You could alternatively call the trigger script as a sub-script instead.

Hope this helps.

2 Likes

That's exactly what I ended up doing...and it worked!

Thanks so much for your kind reply.