UDS event trigger when an existing order is brought up and the Cancel button is hit.

I have scripts that show or hide a button added to the screen depending on certain conditions.  When an order is brought up the button shows/hides correctly.  The issue I am having is if a user brings up an order when the condition is met and the button is shown, then when they click Accept without changing the order or click Cancel I cannot find an event that will trigger for me to hide the button when no order is present.  Can anyone think of a way to have an event triggered at this point?

  • I think you only option is to supersede the Accept and Cancel buttons with your own and then Invoke them after you've done what you need.

  • in reply to connex

    I was going to say that or you could use Enable/Disable instead of Hide/Show.  Most buttons will be disabled when you accept or cancel but sometimes it is necessary to use Hide/Show if you are dealing with a stock button that sage 100 is also toggling Enable/Disable on it and it is occurring after your script fires.

    If you go the other route, you basically create new custom buttons to place on top of the standard Accept, Cancel, OK, and Delete buttons (skip those not applicable) and then have them call the UI object's equivalent method, i.e. BT_Accept, BT_Cancel, etc or use the oScript.InvokeButton method to "trigger" the button they are replacing and then execute your logic to Hide/Show the button afterwards.