GetActionAllowed (validate a requested FormVCR action)

Top  Previous  Next

 

GetActionAllowed( event, action ), VIRTUAL

GetActionAllowed

Checks for a valid FormVCR action.

The GetActionAllowed method is a virtual method used to validate a FormVCR action.

Implementation:

The GetActionAllowed method is called by the TakeEvent method and is used to synchronize toolbar buttons with the appropriate FormVCR action..

Example:

 

 CASE ACCEPTED()

 OF SELF.VCRRequest

  IF SELF.GetActionAllowed(EVENT:Accepted,SELF.Window.Request) THEN

   CHANGE(SELF.VCRRequest,SELF.Window.Request)

   SELF.Window.OriginalRequest = SELF.Window.Request

   SELF.TakeRequestChanged(SELF.VCRPrevRequest,SELF.Window.Request)

   SELF.VCRPrevRequest = SELF.Window.Request

  ELSE

   IF SELF.NoRecords THEN

    SELF.NoRecords = RECORDS(SELF.View)

    IF NOT SELF.GetActionAllowed(EVENT:Accepted,SELF.Window.Request) THEN

     SELF.Window.Request = SELF.VCRPrevRequest

     CHANGE(SELF.VCRRequest,SELF.Window.Request)

     SELF.UpdateWindow

    ELSE

     CHANGE(SELF.VCRRequest,SELF.Window.Request)

     SELF.Window.OriginalRequest = SELF.Window.Request

     SELF.TakeRequestChanged(SELF.VCRPrevRequest,SELF.Window.Request)

     SELF.VCRPrevRequest = SELF.Window.Request

    END

   END

  END

 END