-2

I am using below query to catch errors but I don't want to use these procedures. Instead, I need to suppress the error messages which should not throw during run time.

DO ON ERROR UNDO, THROW:
   FIND Customer 1000.
END.

CATCH eAnyError AS Progress.Lang.Error:
  MESSAGE
   "Error Number:~t" eAnyError:GetMessageNum(1) "~n"
   "Error Text:~t" eAnyError:GetMessage(1)
   VIEW-AS ALERT-BOX BUTTONS OK TITLE "Error processing in the CATCH for mainprocedure block".
 END CATCH.
Bharat
  • 177
  • 7

1 Answers1

2

Use FIND with NO-ERROR function.

Or even better yet, use IF AVAIL before trying to make any modifications, this way it only try to change if it can find the field.

FIND Customer 1000 NO-ERROR.

IF AVAIL Customer THEN DO:
    // Customer exists
END. ELSE DO:
    // There is no customer 1000
END.
Raphael Frei
  • 361
  • 1
  • 10