You must catch the item event et_ITEM_PRESSED for the formtype and for the item you want to work with.
You will receive one with BeforeAction = True and another one with BeforeAction = False.
To have the information about the form type and the item id you can use the View->Debug Information who shows all characteristics for the current selected form. For example, the button Add has UID = 1 and the delivery form has UID = 140.
There is a chapter into the UI API help where the events are explained, UI API How to...->Handle Events.
You can find 2 examples of how to work with events into the SDK UI API samples, they are called CatchingEvents and EventsFilter.
Hope it helps
Trinidad.
Add a comment