AL icon indicating copy to clipboard operation
AL copied to clipboard

It's impossible to add new lines by releasing a document.

Open matteomontanari opened this issue 8 years ago • 3 comments

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

matteomontanari avatar Mar 26 '18 13:03 matteomontanari

Hi,

I will pass your feedback on to the relevant team.

br/Gert

grobyns avatar Aug 03 '18 12:08 grobyns

+1

ThomasBrodkorb avatar Aug 21 '18 06:08 ThomasBrodkorb

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)

AlexanderYakunin avatar Aug 21 '18 08:08 AlexanderYakunin