I found a descrepancy between the way event scripts work for sales order Business Objects (BO) and the way that they work for the invoice BO pertaining to events that are triggereed when the sales order (or invoice) is canceled before acceptance.
When an order or invoice has one or more lines entered and is canceled before acceptance, I need the ability to reverse a setting made to external object for each detail line previously entered. It works well for sales ordes. If the user enters one or more detail lines and cancels the order before clicking Accept, a delete event is triggered for each line of the order and I can reverse the external settings that were made during their entry.
The problem is with invoices. If the user enters detail lines and cancels the invoice before clicking Accept - NO DETAIL DELETE EVENTS ARE TRIGGERED. This means that I cannot synchronize events with elements outside the invoice object. This has been reported and I'm waiting for a confirmation although I can recreate the issue on MAS 90, MAS 200 SQL and non-SQL, 4.40 and 4.50.
Steps to recreate:
1.Add a Table Post Delete method to S/O invoice detail BO with the line:
retVal = oSession.AsObject(oSession.UI).MessageBox("""",""Table Post Delete event triggered!"")
2.Create an invoice with one or more detail lines
3.Click the Cancel button before clicking Accept and note that no messages are presented
If the same steps are repeated for a sales order, a MessgeBox will display for every detail line.