I have a layout and a script is being 'triggered' but non of the objects on the portal are set up with a trigger or as a button. It is clear where a trigger is associated with an object, but not so for a button action. For a button upon double clicking on an object it will show (a) no action, (b) single step or (c) run script. Is there a way to view or sort or filter to determine which button have an associated action tied to it?
When I create a button with a Perform Script, I know only how to link it with one Send Email Script: Template 1. Can you please guide me on how can I develop it that when I click on the button I have the option to chose one of many scripts that I have created previously (Template 1, Template 2, Template 3 etc) and send out the email with the Template I want to? So How can I link a button with several scripts at the same time and not with only one script? I am super new with FMP. Would really appreciate your help. Kind regards.
👏Great video, so clarifying. Thank you!! ❓I'm wondering why are you using a custom function and not another script to put the logic for disabling the triggers, is it because is faster to run, or shorter to use? Thanks again.
That's a good question. I'll do my best to answer. Using another script is certainly possible. However, this is a simple situation of state. As a boolean state of either yes run or don't, we will find that the custom function provides a bit more flexibility and is also "one less" script to manage. All logic within the custom function can be modified/controlled, just like a script, but the code, in many situations will be a bit easier to read. At least this my own personal reason for doing so. I hope that helps out. Thanks for asking!
The custom function has a little bit less overhead when it executes, so it will complete fractionally faster. But the benefit of using a script is that scripts can be interrupted and run through the debugger. Custom functions are evaluated and cached on record load (I think that's still true; I last tested in v14) and, like the auto-enter calculations on fields, get re-evaluated when any referenced objects are updated; scripts are explicitly executed and evaluated at runtime. For simple things like flipping a boolean value, I too prefer custom functions but as far as I'm concerned it's a matter of personal development style.