Sales Orders lines deleted by script screws up Sales Order History

SOLVED

With Sales Order history enabled, lines that are deleted by an event script (Pre-Totals) are not reflected as CancelledLine="Y" in SO History. Thus, there is no way to differentiate deleted lines from lines that remain in the order.  This results in overstated and unusable SO Quote/History reports. Lines deleted in Sales Order data entry are reflected as CancelledLine="Y" and can be filtered.

Any ideas how to identify deleted items? I don't think there is because all other fields are identical (other than the key fields).

Any ideas how to make scripting work as the user interface does?

Parents Reply Children
  • +1 in reply to Kevin M
    verified answer

    I appreciate your help that works!



  • 0 in reply to connex

    UPDATE: The identical problem as described here ALSO occurs with sales order invoicing, but cannot be resolved in a similar manner. The same script, as was changed per 's helpful suggestion, in sales order data entry does not resolve the same issue with invoice data entry. That is, records (Miscellaneous Charge Codes) added in sales order data entry then deleted (and replaced with another similar MCC) in invoice data entry are not marked deleted (i.e. field CanceledLine=Y) and are left as a duplicate in sales order history detail thereby inflating the original order total.

  • 0 in reply to connex

    Idea:

    Pre/Post-Delete script on the invoice line... filtered to the data entry screen (so it doesn't trigger during posting) and check for SO Line Key.  If not blank (indicating it's an SO line being deleted), pop-up a confirmation that the user wants the SO line deleted too (not just removed from the invoice).

    If yes, open a new object to the SO and remove the line.  It may be locked (as being invoiced) but worth a try if you need it.