| **Navigation:**  [[abc library reference.htm|ABC Library Reference]] > RelationManager > RelationManager Methods >====== CancelAutoInc (undo autoincrement) {{c6h0009.jpg|C6H0009.jpg}} ====== | [[addrelationlink set linking fields for a relationship .htm|{{btn_prev_n.gif|Previous page}}]][[abc library reference.htm|{{btn_home_n.gif|Return to chapter overview}}]][[close close a file and any related files .htm|{{btn_next_n.gif|Next page}}]] | | || **CancelAutoInc, VIRTUAL, PROC** {{blk2blue.jpg|blk2blue.jpg}} The **CancelAutoInc **method restores the managed file to its pre-PrimeAutoInc state, typically when an insert operation is cancelled. CancelAutoInc returns a value indicating its success or failure. A return value of zero (0 or Level:Benign) indicates success; any other return value indicates a problem. **Implementation:** The CancelAutoInc method calls the FileManager.CancelAutoInc method for its primary file, passing SELF as the //relation manager// parameter. Return value EQUATEs are declared in ABERROR.INC as follows: **! Severity of error** **Level:Benign  EQUATE(0)** **Level:User    EQUATE(1)** **Level:Program EQUATE(2)** **Level:Fatal   EQUATE(3)** **Level:Cancel  EQUATE(4)** **Level:Notify  EQUATE(5)** **Return Data Type:     **BYTE **Example:** **WindowManager.TakeCloseEvent PROCEDURE** ** CODE** **  IF SELF.Response <;> RequestCompleted** **  !procedure code** **   IF SELF.OriginalRequest=InsertRecord AND SELF.Response=RequestCancelled** **    IF SELF.Primary.CancelAutoInc()  !undo PrimeAutoInc - cascade** **     SELECT(SELF.FirstField)** **     RETURN Level:Notify** **    END** **  END** **  !procedure code** ** END** ** RETURN Level:Benign** **See Also:**     [[cancelautoinc undo primeautoinc .htm|FileManager.CancelAutoInc]], [[primeautoinc prepare an autoincremented record for adding .htm|FileManager.PrimeAutoInc]]