User Tools

Site Tools


cancelautoinc_undo_autoincrement_.htm
Navigation:  ABC Library Reference > RelationManager > RelationManager Methods >====== CancelAutoInc (undo autoincrement) C6H0009.jpg ====== Previous pageReturn to chapter overviewNext page

CancelAutoInc, VIRTUAL, PROC

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:     FileManager.CancelAutoInc, FileManager.PrimeAutoInc

cancelautoinc_undo_autoincrement_.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1