March 5, 201015 yr Newbies I'm having a problem with what I thought would be a simple script. Currently I have 4 different contracts defined in a value list. The user selects the desired contract and then clicks on the "Go to Contract" button that has the following script assigned. However, no matter the selection I am always going to the "Standard Purchase & Sale" contract. I tried using the Else script step between the first 2 options after the 4 individual If . . End If segments. This made no difference. What am I missing? Is there a better way to do this? Following is a portion of the script: Allow User Abort [Off] Set Error Capture [On] # If[Property Analyzer::Contract Selection="California Contract"] Go to Layout["California Contract - Rehab"(Property Analyzer)] Print Setup[Restore; No dialog] Set Zoom Level[150%] Adjust Window[Maximize] Else If[Property Analyzer::Contract Selection = "Oklahoma Contract"] Go to Layout["OK Sales & Purchase Contract - REHAB"(Property Analyzer)] Print Setup[Restore;No dialog] Set Zoom Level[150%] Adjust Window[Maximize] End If # If[Property Analyzer::Contract Selection = "Option Contract"] Go to Layout["Option Contract - Rehab"(Property Analzyer)] Print Setup[Restore;No dialog] Set Zoom Level[150%] Adjust Window{Maximize] End If Thank you for any help you can provide!
March 5, 201015 yr Try the construct: If ElseIF ElseIF EndIF Set Zoom and Adjust window at end (outside of EndIf).
March 5, 201015 yr Author Newbies Thank you so much for that solution!! It worked perfectly! I'm used to writing formulas in Excel so ElseIf is new to me.
March 6, 201015 yr Good morning, Jerry! You have another possible approach here if you make sure your value list of contracts matches your layout names (either adjust one or the other). Make your Contract Selection field a global, fire by button or script trigger, and then script could simply be: Allow User Abort [Off] Set Error Capture [On] Go to Layout[ by calculation ; Property Analyzer::gContract Selection Print Setup[Restore; No dialog] Set Zoom Level[150%] Adjust Window[Maximize] Even if you decide to keep the If/Else/ElseIf construct for the layout scrip-step, you might consider moving the last three lines to the end ( after the EndIf). Since they appear to be exactly the same for all three contracts, you only need to list them once. If you use Go To Layout [by Calculation] then you must remember to keep your value list name and contract's layout name the same. :smile2:
Create an account or sign in to comment