Scripting

  • 1.  I found a descrepancy between the way event script

    Posted 01-09-2012 12:16
    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.


  • 2.  RE: I found a descrepancy between the way event script

    Posted 01-10-2012 09:25
    Sage acknowledges these BO's do not works the same, but that a cancel in order entry is ""different"" than invoice entry therefore its a WAD. They suggest overlaying the Cancel button with a button script, but that doesn't trigger ALT+F4 or clicking the red X to close the invoice. Sage developer's repsonse via support: They are correct that clicking the Cancel button in Sales Order Entry calls the delete method which triggers the Post-Delete event. Sales Order Invoice Entry does not do this. Clicking Cancel on the invoice does not call the delete method or trigger the Post-Delete event. This is because these objects (SO_SalesOrder_UI and SO_INVOICE_UI) have different requirements when the Cancel button is pressed. SO Invoice Entry behaves differently; Cancel is not the same as Delete and the Cancel Logic does not the Delete events as is does in SO Order Entry. We would not change this. An enhancement could be submitted to add Cancel events into Customizer Scripting. An alternative for them rather than using the event scripting is to replace the Cancel button in Invoice Entry with their own Customizer button and hang their script off of the customized button. If they truly want to do something on cancel of the Invoice.