cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Can I extend an EventHandler with a new operation?

LukasG
Explorer
0 Kudos
450

Hello Community,
I added a new field to my Opportunity extension which is responsible for counting the corresponding products on root-level.
Now I wanted to refresh this field, everytime a product is added or removed.
After adding a product I use the "AfterModify" script on the Item.node.

But if I remove the product via the "DeleteBin" icon the "OnDelete" script isn´t triggered.
I saw the icon has a OnRemoveProduct EventHandler assigned. But I can´t figure out how extend this EventHandler.

Is there a possibility to extend the EventHandler or is there another way to update the field on deletion?

Best regards, Lukas

View Entire Topic
dominik_g
Participant
0 Kudos

Hi Lukas,

changing SAP Standard EventHandlers is not possible in the UI Designer.

However, you can try to accomplish your goal by using an OnDelete-Event (.absl Script file). Please be aware that On-Delete Events are not available for all nodes and sometimes they are only available for the root node.

If there is no On-Delete event available for the node you would like to extend, you may need to implement your script logic in After-Modify or Before-Save on level of the root node:

1) In After-Modify of Opportunity.Item, create a custom BusinessObject that is connected to the Opportunity ID and the Item UUID

2) In Before-Save of Opportunity.Root, you could check all items of the Opportunity instance and cross-check your custom BusinessObjects that are assigned to the same Opportunity, for which no Item exists anymore.

Anyway, I think moving your whole script logic to Opportunity.Root-BeforeSave would be suitable.

Regards

Dominik