Kbase P16195: How to trap the indexing error message** already exists with . (132)
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  25/05/2010 |
|
Status: Verified
GOAL:
4GL/ABL: How to trap the indexing error (132)?
GOAL:
When is the error " ** <file-name> already exists with <field/value...>. (132) " generated?
FACT(s) (Environment):
All Supported Operating Systems
Progress 9.x
OpenEdge 10.x
OpenEdge Category: Language (4GL/ABL)
FIX:
This error is generated when an attempt is made to create a new record with a unique index field(s) having the same value(s) as in an already existing record.
The following code sample demonstrates one way to trap for the indexing error (132) by requesting a customer number from the user and trying to create a new customer record. If the create operation fails, the customer is advised to input a valid customer number:
DEFINE VARIABLE iCustNum AS INTEGER NO-UNDO.
REPEAT:
iCustNum = 0.
UPDATE "Enter new customer number" iCustNum.
RUN CreateCustomer(INPUT iCustNum).
END.
PROCEDURE CreateCustomer.
DEFINE INPUT PARAMETER piCustomerNumber AS INTEGER NO-UNDO.
CREATE customer NO-ERROR.
ASSIGN
cust-num = piCustomerNumber NO-ERROR.
IF ERROR-STATUS:ERROR THEN
MESSAGE
"Customer already exist with that number...Try again"
VIEW-AS ALERT-BOX INFO BUTTONS OK.
END PROCEDURE.