hi guys. we are having a problem in some of the sales order we have and we don’t know why this happen. when we checked someof the sales order, the sales header is missing but when we checked the sales line is is actually in the list, we are checking using the object designer using the tables sales header and sales lines. please advise if you encounter this and can someone please tell me on how to resolve this issue, we want to delete the sales line since it is already completed.
1 - The code in the OnDelete trigger of the sales header table was modified, and it now does not remove related sales lines when DELETE(TRUE) is called
2 - The default parameter value of the DELETE command is FALSE, so by default it does not run the OnDelete code. Somewhere in the code there is a SalesHeader.DELETE statement without explicitly setting the parameter to TRUE. The developer assumed that SalesHeader.DELETE also removes the related sales lines.
Do you know the report design? You can do that with a report.
“Run” all your sales line and check if the corresponding SalesHeader exist. If not, just delete the SaleLine. But carefull,don’t forget you have different document types.
If you don’t know how to do it, please ask here for some line of code.