December 1, 200520 yr Maybe this isn't possible but I thought I would ask. I am trying to make my script parameters "dynamic" so if you loop through records, the calculation in the script parameter works for that record. However, it seems to be a static value that gets passed once. I wrote a custom function to capture all parts of an email and want to use that as multiple script parameters. Then I can use one email script and pass different calculations into the email body, etc. However, it seems like the parameters pick up the first record's info. and then that's it...even if I call the parameters again in a loop. Hmmm. Am I doing something wrong or is this not possible??
December 1, 200520 yr Out of curiosity, if you are using FM8 why arent you using variables instead or in conjunction with Script Parameters?
December 1, 200520 yr Author I wanted to avoid variables for one reason. I have so many specialized email bodies with calculations that I would have to have a variable for each one to pass into the email setup. I also have to specialize the setup for several different depts. since the TOs are different. I was thinking that if I could pass the calc through a parameter, that would help my sanity.
December 1, 200520 yr I'm not aware of how to change the parameter once inside the script, but it's certainly possible to pass multiple values with one parameter, under certain conditions. Supposing that each value is one word long, separate each value with a carriage return. Then in the script, use the MiddleWord function to extract out the "word" that is needed. I can explain in more detail if this is what you were looking for.
December 1, 200520 yr Author I already have multiple parameters set up - no problem there. But I am not passing static words - I need to pass dynamic calcs. So, once the parameter is passed for the first record, there is no way to make it dynamic for the second record - even if I have it call the parameter in a loop.
December 1, 200520 yr I don't quite see why you can't use a single script variable in the same way as you use the script parameter. However, you can change the script parameter by calling the script with a new parameter in a loop, something like: Go to Layout [ "TableA" ] Show All Records Go to Record/Request/Page [ First ] Loop Perform Script [ "SingleStepSubScript"; Parameter: TableA::Source ] Go to Record/Request/Page [ Next; Exit after last ] End Loop
December 1, 200520 yr Could you pass the calculation as a parameter in quotes, and then use the Evaluate() function? i.e. DoMyScript( " "Max(Table1::Field1, Table2::Field2) " )") Then, to use this set up a calc field which is myfield = Evaluate(theparameterfield) Edited December 1, 200520 yr by Guest
December 1, 200520 yr Author that did the trick! passing the parameter in quotes and using the evaluate worked like a charm. Thanks!
Create an account or sign in to comment