Thank you for your post.
The modified value will not show the first time, because there was nothing to evaluate. Perhaps you meant to use OnObjectSave. This will then display the new value; not the modified value.
you misunderstand. if there was nothing to evaluate then the OnObjectModify would not run.
by selecting an item from the pop-up menu the global field is modified.
that is why the trigger OnObjectModify runs the script.
i am using it for a search just like the example given at the end of script trigger part 1 video posted on filemaker's website. but instead I use is a pop-up menu.
Thanks for the heads up. However, the OnObjectModify with a pop-up menu seems to work differently. I'll forward that information to the appropriate departments. In the mean time, use OnObjectSave with a pop-up.
Here's a simple test.
Create a field with a value list with three values
Create a script that does the following:
Set Variable [ $x ; Get (ScriptParameter) ]
Show Custom Dialog [ "TEST" ; "The value is " & $x ]
Attach this script to your existing script trigger. Select "1" and you will have no value. Select "2", and you will get the message "The value is 1".
Change this to OnObjectSave and it works correctly.
It seems to be working fine. I was actually passing a parameter with a calculation. If I pass the field name and then do the calculation into the variable, it works fine. That is, the example I gave you should work fine. Sorry for the confusion.
Let me know exactly what is the parameter you are passing, and what is the value list.
thanks for the fast response and the work around!
this is a bug. the OnObjectModify and Set Variable does not work the first time only after opening a New Window.
i am using OnObjectModify with pop-up menu all over and they work fine as long as I don't open a new window and try to set variable.
yes, I am passing the field name.
The value list which has two values and only the second shown for the pop-menu is:
parameter being passed is: GetAsNumber (Main::gActionSearch)
Now, it is not working.
Ooops... I see the problem. I have one field set up to be OnObjectModify, and another with OnObjectSave. The OnObjectSave works correctly, the OnObjectModify does not. My fault.
I have reported the information to our Development and Software Quality Assurance (Testing) departments for more information.