AnsweredAssumed Answered

Script is Paused [Continue] [Cancel] on in the layout bar

Question asked by miw on Feb 9, 2009
Latest reply on Feb 16, 2009 by Orlando

Title

Script is Paused [Continue] [Cancel] on in the layout bar

Post

I have a script that checks to see that I have a unique input for a field named Location:Location.  Here it is:

 

If [IsEmpty (Location::Location)]

Show Custom Dialog ["Input Error";"A valid location name must be input (not a duplicate)! Select 'OK' to resume editing this record, 'Revert' to revert back to prior status."]

If[Get(LastMessageChoice) = 3]

If[Get (RecordOpenState ) <> 1

Revert Record/Request [No Dialog] 

  End If

Go to Field [Location::Location] 

Enter Browse Mode [Pause]

End If

If[Get(LastMessageChoice) = 2]

Revert Record/Request [No Dialog] 

Commit Records/Requests [No Dialog]

End If

End If 

 

It works reasonably well except when I opt to "revert" (a button selection on my layout which reverts back to prior status via a Revert Record/Request command) out of the field input at which point my custom dialog box opens as noted in the script; if I chose the "revert" option [#2] in the dialog box everything works out fine; I am out of the edit mode and everything is back to the way it was.  However, if I choose "OK" in the dialog box, I go back to the Location::Location field as directed by the script to resume editing as desired - but, if I opt to "revert" again, everything goes back to the way it was (no new record created or edit made, which is a good thing) but I notice that the script keeps running in my layout screen (the prompt is "Script is Paused [Continue] [Cancel] on in the layout bar).  I do not want to have to constantly check the layout bar to see if the script is paused; how can I get revise my script to stop if I opt to "revert" the second time?

 

 

 

 

Outcomes