Reputation: 55
I was wondering, is it possible to read or modify click event of a button that belongs to a system form in SAP Business One?
Upvotes: 1
Views: 4659
Reputation: 2873
Yes, it is. Set up your form type and event type filters appropriately. Then you'll be able to attach an event handler to ItemEvent. When the handler fires, respond to events for the ItemUID of the system button you're interested in. IN your event handlers you'll typically have something like this:
If pVal.FormTypeEx = “150” And pVal.ItemUID = “1” And pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED And pVal.BeforeAction = True Then
'do something
End If
You can find the ID of the button by turning on System Information in the 'View' menu and hovering over the UI element. The ID and some other information is shown in the status bar.
The "OK" and "Cancel" buttons have IDs 1 and 2 on many forms.
Upvotes: 1