Showing results for 
Search instead for 
Did you mean: 

How to tell when a line item has been removed from a sales order.

0 Kudos

Hey SAP,

I am trying to figure out how to tell when a user removes a line Item from a sales order or sales quote.

There are certain items that when added trigger other things to be created. This works great when the user is perfect at entering data into SAP but if they delete an item I need to be able to undo any calculations that I did when the item was added in the first place.

I would have thought this would be a perfect time to use the OnDelete event but when stepping through the code I do not see that event getting triggered when hitting the remove button on the sales order.

I then saw that I can invoke the delete function on an Item which may trigger the OnDelete Event.

I stepped through the code again and can only see the after modify event being triggered and the list of items that I am able to retrieve does not contain the item that was deleted.

That doesn't really help me since I can't really tell what was removed if I don't have the original to compare it to.
I then found the GetFromDB Function that was added in 1902 which I thought may help so I could see what was saved to compare to the buffer that I am seeing but It looks like I can only use that on an individual object and not a collection of objects which puts me back at square one 😞

Is there something super obvious that I am missing?


View Entire Topic
0 Kudos

I finally figured out that the OnDelete event does not get triggered until the OnSave Event is triggered.

0 Kudos
HI Isaac,

When you are adding additional information to your question do use comment not answers...