[Event Request] Maybe...not 100% sure...
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.
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.
Sounds good - that should work.
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;
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.
How do you post than? Why do you need to use COD11 if you can post directly by COD12 using RunWithoutCheck?
Regarding CheckSalesDocNoIsNotUsed, we can add following:
[External] CheckSalesDocNoIsNotUsed(DocType : Option;DocNo : Code[20]) OnBeforeCheckSalesDocNoIsNotUsed(DocType,DocNo,IsHandled); IF IsHandled THEN EXIT;
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.).
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