ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

Codeunit 313 Sales-Printed SuppressCommit

Open KReinmann opened this issue 7 years ago • 11 comments

Hello,

for external use we need an enhancement of Codeunit 313 to avoid COMMIT. We Need a global variable, which can be set via Event.

  • New global variable SuppressCommit (Boolean)
  • New Event OnAfterModify(VAR SuppressCommit)
  • Perform commit depending on new variable SuppressCommit)

The same functionality is needed in the following Codeunits:

  • 314 Sales Shpt.-Printed
  • 315 Sales Inv.-Printed
  • 316 Sales Cr. Memo-Printed
  • 317 Purch.Header-Printed
  • 318 Purch.Rcpt.-Printed
  • 319 Purch. Inv.-Printed
  • 320 PurchCrMemo-Printed
  • 321 Purch.HeaderArch-Printed
  • 322 SalesCount-PrintedArch

Thank you in advance, best regards, K.

Thank you, Best regards K.

KReinmann avatar Jan 24 '19 10:01 KReinmann

Hi,

we do not want to provide an event that allows you to set the SuppressCommit variable. If you look in Codeunit 80 you will see that we have a SetSuppressCommit function which you can call to set the value. The events only pass along the value, they do not allow you to change it. This is by design. In order to use SuppressCommit you have to create a variable for the codeunit and from then on you take responsibility for suppressing the commit or not. The reason we do not want to provide this capability through an event is because it would allow any extension to change the behavior without anyone being able to control it. We do not want to randomize when a COMMIT is run or not. With the current design, you explicitly take control (and responsibility) for what happens.

Please let us know if you can refactor your code to use SuppressCommit in this way in which case we can add the SetSuppressCommit to the codeunit(s).

br/Gert

grobyns avatar Jan 29 '19 10:01 grobyns

Hi,

In order to use SuppressCommit you have to create a variable for the codeunit and from then on you take responsibility for suppressing the commit or not. It would be great, if a function will be provided in future shipments with a function (not an Event) like it is provided in CU 80.

Best regards, Kathrin

KReinmann avatar Jan 29 '19 11:01 KReinmann

Hi,

we will add it to our backlog. We’re entering the endgame for the Spring ’19 release and we need to focus on finishing up so unfortunately I cannot promise what update this will ship in.

br/Gert

grobyns avatar Jan 29 '19 12:01 grobyns

Hi,

this will be fine with us, if the issue will be solved in the future. :-) So, in future shipments the solution would look like in CU 80? Is this solution set? So, we are able to continue with our refactoring.

Thanks in advance, best regards, Kathrin

KReinmann avatar Jan 30 '19 09:01 KReinmann

Hi,

Are there new insights here?

Thanks in advance, best regards, Kathrin

KReinmann avatar May 06 '19 12:05 KReinmann

@JesperSchulz

KReinmann avatar Aug 29 '19 10:08 KReinmann

Another one of your issues which fell of the radar! That's is odd! Anyway, again it would appear that your issue has been resolved after all. This time a work item was created and I can see that it was resolved the 14th of May - meaning it should have shipped with the fall release in October! Could you reply back if everything is as you hoped it would be now?

JesperSchulz avatar Nov 14 '19 08:11 JesperSchulz

@JesperSchulz Hi Jesper, my collegue K. Reinmann started this request. Unfortunatley the provided function to supress the commit is useless right now. The calls in standard source code look always like this. "CODEUNIT.Run(CODEUNIT::"Sales-Printed", "Sales Header");" So there is no chance to call a "SuppressCommit" function. Could you please check it and provide a feedback / solution? Many thanks.

MaKnauer avatar Nov 26 '19 12:11 MaKnauer

This would be possible if the IsReportInPreviewMode functions in Reports were designed so that they are extendable so that we can alter the output result of those functions.

plagijat avatar Nov 26 '19 13:11 plagijat

I have opened a follow up bug for your issue for the team, which made the initial implementation. They should return to this thread with a solution :-) If not, please create a new issue, as we're not very often revisiting "old" tickets.

JesperSchulz avatar Dec 10 '19 13:12 JesperSchulz

The follow up bug was not accepted, as the initial issue has been addressed. I would suggest to create a new issue with the same content, if you cannot make the solution work for you. Could you not just refactor your code to create a variable, instead of using CODEUNIT.RUN? Of course, I don't at all know what your code looks like, and I hence cannot consult.

JesperSchulz avatar Dec 19 '19 14:12 JesperSchulz