How do write code to a standard button before execution?

SUGGESTED

Hi, 

There is something wrong with my code and I am not sure what is wrong with it. The E represents the standard button, save, code for the screen. 

Thanks!

##########################################################

$AVANT_E

If [M:ALL]STA(nolign-1) = "A"
GMESSAGE="This product is in AR status!"
mkstat=2
Endif

Return

######################################################

Parents
  • 0
    SUGGESTED

    Try below code snippet

    $AVANT_ACT

    Case BOUT

      When "N"

          #You can write code here

    Endcase

    Return

    Thankyou,

    Shereef N

  • 0 in reply to Shereef

    I think is better: AVANTBOUT Before item or button is executed if we are talking about an object.

    Additional Info:

    • APRES_CHOI After user has selected window option / Before the action is executed
      AVANTBOUT Before item or button is executed
    • Menu action is executed
      EXEBOUT After button action is executed
      SETBOUT When window/buttons are redrawn (Window is refreshed)

    If you do that:

    $ACTION

       if GUSER="your AUS_COD" : infbox ACTION : endif

    ........

    ........

    ......

    return

    youy will see the X3 actions logic for the object: OUVRE, DEFTRANS, VARIANTE,etc. etc.

    Best Regards!

Reply
  • 0 in reply to Shereef

    I think is better: AVANTBOUT Before item or button is executed if we are talking about an object.

    Additional Info:

    • APRES_CHOI After user has selected window option / Before the action is executed
      AVANTBOUT Before item or button is executed
    • Menu action is executed
      EXEBOUT After button action is executed
      SETBOUT When window/buttons are redrawn (Window is refreshed)

    If you do that:

    $ACTION

       if GUSER="your AUS_COD" : infbox ACTION : endif

    ........

    ........

    ......

    return

    youy will see the X3 actions logic for the object: OUVRE, DEFTRANS, VARIANTE,etc. etc.

    Best Regards!

Children
No Data