It's unclear from your screen shots what your parameter is. Post a screen shot that shows the full width of the Set Script Triggers dialog box and there may be something there to diagnose.
First, let me assure you that fired script triggers use the script parameter you input when selecting the script to run upon firing of the script trigger. So that is not an issue. There has to be something in the way you are setting up the Script Trigger. First of all, I am assuming you have tested things with Script Debugger to assure the script is firing when you expect? Are there multiple script triggers on this field? I think your first picture was showing testing of the value of the script parameter in the data viewer, I assume while debugging the script. Right? Would you mind sharing a screen shot of your script if it is not too long? If you want, I can email you a file with a script trigger on validation that grabs the script parameter. Let me know if that would help.
It would be helpful if you could post a screen shot that shows the full width of the Set Script Triggers dialog box. This screen shot is of the Manage Script dialog box.
It would also be helpful to see a screen shot of the Script Debugger with the script running, but at the very end of it and the Data Viewer on the Current tab, both in the same shot.
Get ( RepetitionNumber ) isn't a function. Maybe you mean Get ( CalculationRepetitionNumber )? If so, that won't work for anything on your layout. If you mean Get ( ActiveRepetitionNumber ), then that should return the repetition number that the cursor is in.
Another possibility ... Your second screen shot shows Get(ScriptParameter) as the repetition value. I would bet that should be normal 1 (since I doubt you are writing to variable repetitions).
Then start script with lines:
Set Variable [ $p ; Get ( ScriptParameter ) ]
... Now run debug ... does $p show your value? If so then it is reaching your and once there, you can use it within your script. If only used once within the script, you do not need to write it to $p first but I like to because then it is clear in the script that it used a parameter and if the parameter is multiple values then it is easier to parse into multiple variables from there.
Please allow editing from iPad ... Correction on the post to say "... If so then it is reaching your SCRIPT"
Thanks for everyone help. I do love this community. I will try to explain better.
The purpose of the script is to enter data in all related records at the same time with the same data for a single field and again for a second field (different data) and then a third field.
I use 3 repeating fields and use script parameters so I have only one script. The script fires ok, the data is copied to all related fields, but always the data from repetition 1 not 2 or 3. If I use a calculation to determine the repetittion or I use 1, 2 or 3 data from repetition is what is copied.
David - I stated "Get ( RepetitionNumber )" from memory. In practice I used "Get ( ActiveRepetitionNumber )" But when I used "2" the script copied date from repetition 1(the default)
Taylor - Script does fire and only one script trigger I posted the
This may work by using 3 seperate fields. So they may be an easier way. But I like to understand why something does not work before I move on.
'Set Variable [$$gty(Get (ScriptParameter )]; Value:DEL::QtyPerPackage[Get ( ScripParameter )]
in the second line to get the second rep in the $$qty
Ruben van den Boogaard
created by SteveNoble in General - View the full discussion
David here is the debugger/data viewer https://fmdev.filemaker.com/servlet/JiveServlet/downloadImage/2-101866-3036/351-600/ScreenShot2012-12-01at11.05.29+AM.png
Notice the value for rep [2} is 87, however the $$qty is 50 which if the value for rep 1
Reply to this message by replying to this email -or- go to the message on FileMaker Technical Network
Start a new discussion in General by email or at FileMaker Technical Network
Manage your email preferences.
FileMaker Developer Conference 2013 • San Diego, California • August 12-15 • www.filemaker.com/devcon
Just for a quick check, try
In the repetition field.
One other possibility, a needed extend function to provide the non repeating field access to the 2 and 3rd repetition values. Extend allows the value of a non-repeating field to be used with every repetition of a repeating field. Without this function, the value of the non-repeating field would only be used with the first repetition of a repeating field when evaluating the two fields in the same calculation.
Hope one of these gets u 1/4 of the way home !
Steve, we could be at this all day. Is it not easier to attach your file?
I tried this and it broke the whole thing.
I will try this tomorrow when I get back to the office
This is my working fie although this part is all new fields and records. As soon as I can clone and strip other parts out I will post. Thanks