You can't put the calculation into the script step. What you can do is use the step to go to any compatible layout--to get the found set, then use either form of go to layout by calculation in order to get to the desired layout.
Seems like to me just use a nested if.
If Contract type = Type1
go layout [type1]
Else if Contract type = Type2
go layout [type2]
Else if Contract type = Type3
go layout [type3]
Else if Contract type = Type4
go layout [type4]
The GTRR button inside a filtered portal will go to the "filtered" related records.
Use 'Layout by calculation...' to dynamically to go to the correct one.
layout_by_calc.jpg 57.1 K
Thanks for the posting Beverly. Great article and examples.
Using Layout by calculation, you could use something like:
Go To Related Record from Table "Contract" using Layout by calculation.
The calculation you'd use would be something lime:
ContractType = Type1 ; "Layout for Contract Type 1" ;
ContractType = Type2 ; "Layout for Contract Type 2" ;
ContractType = Type3 ; "Layout for Contract Type 3" ;
ContractType = Type4 ; "Layout for Contract Type 4"
That would get you to the proper layout, and the record you clicked on would be the active record. If you need to get to JUST that record, there'd be other methods I'd use. (I'd set a variable to $RecordID = PKofTheClickedRecord, enter find mode, go to the proper layout, and find the proper record).
By the way...you COULD do the above in your GTRR script step, but I probably wouldn't do it that way. I'd probably use greatgrey's method. Why? Well...in my example above, because the layout names are in quotations, if the layout names are ever changed, this step would "break". If you use greatgrey's method of actually using FM's pulldown menu to select from among the layouts you have, FM will automatically adjust as needed if a layout name is changed.