You can use Let() anywhere you have access to the calc engine and set the value of Exit Script result to $result and use it later in the script to send the user specific places via script.
Thank you both. As suggested the Get (LastMessageChoice) sorted the Exit (see below). The problem is that the OnPanelSwitch trigger when applied to my tab_calcs, also gets applied to other tabs. Is there a way around this? Or, as Beverley suggested in a different post, is it better to dump tabs and use other objects (though this would create quite a lot of short term grief I have to say!).
Commit Records/Requests [ No dialog ]
If [ ( IsEmpty(Calc_n::cm) or IsEmpty(Calc_n::kg) )]
Show Custom Dialog [ Title: "Complete Calc info"; Message: "You should complete critical fields before leaving this tab:"&¶ & If(IsEmpty(Calc::cm);"cm";"") &¶ &
If(IsEmpty(Calc::kg);"kg";""); Default Button: “Complete”, Commit: “Yes”; Button 2: “Switch tab”, Commit: “Yes” ]
Exit Script [ Result: Get ( LastMessageChoice ) = 2 ]
If [ GetValue ( Get ( TriggerCurrentPanel );2 ) ="tab_calcs" and ( IsEmpty(Calc_n::cm) or IsEmpty(Calc_n::kg) )]