February 4, 201510 yr Hi there, I'm experiencing an issue with script trigger not working when a fresh layout is loaded. Here are a number of examples: OnModify script trigger on a drop down list The user goes to a new layout they select a drop down field which has a script trigger attached to it the first time it's selected nothing happens the second time onwards it begins to work OnObjectModify script trigger of a edit box being used as a filter The user goes to a new layout they type 1 character in the field with eh script trigger nothing happens they type a second character and the script triggers the field is cleared One character is typed The script triggers It seems that for some reason the script trigger must be triggered two times before it will work, after that it works every time. This only happens the when a new layout is loaded. I have experienced this both on windows and filemaker go Has anyone else had this issue and was there a work around? Users don't understand why it's not working the first time and often just stop the process.
February 4, 201510 yr In this document... http://help.filemaker.com/app/answers/detail/a_id/7465/~/understanding-and-using-script-triggers The first bullet point in Additional information reads "Script triggers execute based on changes or actions performed on layouts and layout objects directly." This suggests that the reactions you are seeing are how the OOM trigger is supposed to perform. The object is not actually modified until you type the second character. Just my 2cents
February 4, 201510 yr That's not my experience though. Obviously onModify only runs when you actually modify something so selecting the same value from a dropdown as was already in the field is not going to trigger it. But typing a new character in the field always and consistently runs the OnModify for me. You mention that on the 2nd character type the field is cleared and only one character shows? That makes me think that you have other triggers going on too. What other ones are active on that layout and that field (onLayoutKeystroke / ObjectKeystroke / recordLoad, ObjectEnter,...)?
February 4, 201510 yr Author Thanks for your input, The second example is a little more complicated - so I'll stick with a simple scenario Goal: Filter a portal with Value list options in a global (drop down) field. In General it all works. it's only when the layout is first loaded and the filter is triggered fro the very first time that it doesn't work. I have enabled the script debugger and I can see that the script is indeed triggering and completing but the portal isn't filtered. I have tried both of the following: Navigating to the layout, then triggered the filter - no change in filtering Switch from layout mode to browse mode - no change in filtering The script is triggered, but it doesn't actually effect the portal filtering, every time I run it after the first time trigger it works without fail.
Create an account or sign in to comment