December 5, 200520 yr I have a script in a solution that first exports data from a table and then carries out various other script steps. My problem is that when a user presses the cancel button on the export script it continues on running the rest of the script. I want all the other script steps to only be activated if the import command is carried out. (Oh and the export step needs to be have dialogue turned on.) Cancelling an export script step does not seem to generate an error message. I have the same problem with an import script step. In this instance, if the user cancels the script step OR they try to import the wrong type of file. ANy help would be appreciated
December 6, 200520 yr Yes: Error 1 = user cancelled action. Try this in your script: Allow User Abort [on] Set Error Capture [on] Export [] Set Field [gError = Status) CurrentError )] Allow User Abort [off] Set Error Capture [off] If( gError = 0 ) # Export completed Else #Export cancelled or failed End If Edited December 6, 200520 yr by Guest
December 6, 200520 yr Author thanks for that Vaughn. I tried something like that earlier and it didn't work. However, thanks to you I realised I was not using the set field step directly after the import step. Cheers. That has saved me no end of headaches!!!
Create an account or sign in to comment