ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Request] Maybe...not 100% sure...

Open RHansenEpimatic opened this issue 8 years ago • 8 comments

To migrate a NAV add-on to an app/extension...

Our product has a scenario where we need to bypass the "CheckSalesDocNoIsNotUsed" and "CheckPurchDocNoIsNotUsed" functions in codeunit 11. In our product we added a field to the Gen. Journal Line table for this purpose - "Bypass Doc. No Check" (boolean) and then modified the logic in codeunit 11 to bypass those checks whenever this field is TRUE. Somehow i need to be able to do the same thing in an extension.

RHansenEpimatic avatar Nov 22 '18 21:11 RHansenEpimatic

You are asking for a event with a parameter. In your extension you can create the field in the table and then using the event you can modify the behaviour of the codeunit 11 using this parameter and the created field. Lot of events have been requested here with that idea.

frivadulla avatar Nov 23 '18 09:11 frivadulla

Sounds good - that should work.

RHansenEpimatic avatar Nov 23 '18 11:11 RHansenEpimatic

We already have function in COD80 and CODD90 to skip check (although I think you need to check document before you post somehow):

[External] SetSkipCheckReleaseRestrictions() SkipCheckReleaseRestrictions := TRUE;

AlexanderYakunin avatar Nov 26 '18 06:11 AlexanderYakunin

Hi Alexander -

Our add-on has processes where it posts directly to customer and vendor accounts without going through codeunits 80 / 90, so we need a way to bypass this check directly in codeunit 11.

RHansenEpimatic avatar Nov 26 '18 14:11 RHansenEpimatic

How do you post than? Why do you need to use COD11 if you can post directly by COD12 using RunWithoutCheck?

AlexanderYakunin avatar Nov 26 '18 14:11 AlexanderYakunin

Regarding CheckSalesDocNoIsNotUsed, we can add following:

[External] CheckSalesDocNoIsNotUsed(DocType : Option;DocNo : Code[20]) OnBeforeCheckSalesDocNoIsNotUsed(DocType,DocNo,IsHandled); IF IsHandled THEN EXIT;

AlexanderYakunin avatar Nov 26 '18 14:11 AlexanderYakunin

That would be great if you can do that for both checks! We don't want to post without running checks as it opens up risks for invalid postings (invalid dimension combinations, etc.).

RHansenEpimatic avatar Nov 26 '18 15:11 RHansenEpimatic

Hi everyone , Any Idea on How to bypass the CheckPurchaseReleaseRestrictions? I want to be able to change the boolean variable (SkipCheckReleaseRestrictions) before the function. OnBeforeReleasePurchaseDoc(PurchaseHeader,PreviewMode); IF NOT (PreviewMode OR SkipCheckReleaseRestrictions) THEN CheckPurchaseReleaseRestrictions;

Thanks

sradouan avatar Jun 21 '19 13:06 sradouan