AnsweredAssumed Answered

Exiting a script with conditional execution

Question asked by macmesser on Dec 19, 2013
Latest reply on Dec 19, 2013 by macmesser

Title

Exiting a script with conditional execution

Post

     I have a script with a custom dialog with three buttons, which I want to perform one of two searches based on button returned or do nothing and simply exit the script, which appears below. Is the exit script[ ] step needed or even correct? The help file says exit script [] is used to exit an external script or subscript. Will it work in this way or should I just leave the final "else if" clause empty? What would be the best way to pass a value from this script if the final "else if" clause is executed? Thanks for any insights. ps- how do I change text size on this forum?

     Show Custom Dialog [ Title: "Display records according to keywords"; Message: "Do you wish to show records with or without a value
     for the keywords field (Custom Field 1)?"; Default Button: “Show with keywords”, Commit: “No”; Button 2: “Show without
     keywords”, Commit: “No”; Button 3: “Cancel”, Commit: “No” ]
     If [ Get ( LastMessageChoice )=1 ]
     Perform Find [ Specified Find Requests: Omit Records; Criteria: Inventory_Items_POS::Custom Field 1: “=” ]
     [ Restore ]
     Else If [ Get ( LastMessageChoice ) = 2 ]
     Perform Find [ Specified Find Requests: Find Records; Criteria: Inventory_Items_POS::Custom Field 1: “=” ]
     [ Restore ]
     Else If [ Get ( LastMessageChoice ) = 3 ]
     Exit Script [ ]
     End If

      

Outcomes