on 2022 May 11 1:40 PM
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
Request clarification before answering.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 14 | |
| 8 | |
| 6 | |
| 6 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.