It's impossible to add new lines by releasing a document.
Issue: It's impossible to add new (valid) lines by releasing an order or an invoice.
If we do a manual release before posting it's all ok.
If we post an invoice, CU80 calls this internal function:
LOCAL ReleaseSalesDocument(VAR SalesHeader : Record "Sales Header")
inside this function it checks a return value to update its internal "TempLines":
LinesWereModified := ReleaseSalesDocument.ReleaseSalesHeader(SalesHeader,PreviewMode);
IF LinesWereModified THEN
RefreshTempLines(SalesHeader);
If we subscribe CU414.OnBeforeReleaseSalesDoc(VAR SalesHeader : Record "Sales Header";PreviewMode : Boolean) we cannot change the return value "LinesWereModified" because parameter has not passed.
If we subscribe CU414.OnAfterReleaseSalesDoc(VAR SalesHeader : Record "Sales Header";PreviewMode : Boolean;LinesWereModified : Boolean) LinesWereModified parameter is not "VAR".
So we can add new lines to a sales document but CU80 will not posts them.
Same problem on Purchase side (CU90&CU415)
Tested on NAV2018CU3
Hi,
I will pass your feedback on to the relevant team.
br/Gert
+1
Is it OK for you if I will make LinesWereModified as VAR in this event? CU414.OnAfterReleaseSalesDoc(VAR SalesHeader : Record "Sales Header";PreviewMode : Boolean;LinesWereModified : Boolean)