AnsweredAssumed Answered

Best practice for fields with OnObjectModify script trigger in list or table view?

Question asked by Adrian Nier on Feb 12, 2018
Latest reply on Feb 12, 2018 by beverly

My case involves a list view with a container field called Product::Image. The container field has an OnObjectModify script trigger. The attached script uses AppleScript to modify the current image and save it in a field called Product::Image_converted. This works great as long as the user is on the same record as the modified field.

 

Now in list view for example the current record might differ from the one where the Image field is modified. This happens when the user drags and drops a file into the field of another record than the current record. Referring to Product::Image in the triggered script gets the image of the current record not necessarily the one that was modified. Of course, setting Product::Image_converted will also update the correct field on the wrong record.

 

My approach is to set an Auto-enter calculation for Product::Image_converted that clears its value when Product::Image changes. In my triggered script I search for all records that have a value for Product::Image and none for Product::Image_converted, which ideally should only be that one record.

 

As I only now found out about this behavior, it looks like I’m going to spend some time checking each script that might get triggered while in list or table view. Am I missing a technique that allows us to more easily identify the record on which a trigger is started?

Outcomes