raingirl Posted December 1, 2005 Posted December 1, 2005 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??
mr_vodka Posted December 1, 2005 Posted December 1, 2005 Out of curiosity, if you are using FM8 why arent you using variables instead or in conjunction with Script Parameters?
raingirl Posted December 1, 2005 Author Posted December 1, 2005 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.
BrentHedden Posted December 1, 2005 Posted December 1, 2005 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.
raingirl Posted December 1, 2005 Author Posted December 1, 2005 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.
comment Posted December 1, 2005 Posted December 1, 2005 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
xochi Posted December 1, 2005 Posted December 1, 2005 (edited) 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, 2005 by Guest
raingirl Posted December 1, 2005 Author Posted December 1, 2005 that did the trick! passing the parameter in quotes and using the evaluate worked like a charm. Thanks!
Recommended Posts
This topic is 6934 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now