Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Extensibility Request] Release Purchase/Sales Document SkipWhseRequestOperations #22801

Open
BernhardKloibmueller opened this issue Apr 3, 2023 · 3 comments
Labels
event-request Request for adding an event SCM GitHub request for SCM area

Comments

@BernhardKloibmueller
Copy link
Contributor

Through a support request in the "Release Sales Document" or "Release Purchase Document" Codeunits there were added a global variable "SkipWhseRequestOperations" to skip update of Warehouse Request table, due to unnecessary lockings on the table during these processes.

I requested to add events to control these new variables which was mentioned I should do this here.

Procedure "Code"

            Modify(true);

            if NotOnlyDropShipment then
                if "Document Type" in ["Document Type"::Order, "Document Type"::"Return Order"] then
                    if not SkipWhseRequestOperations then
                        WhsePurchRelease.Release(PurchaseHeader);

            OnAfterReleasePurchaseDoc(PurchaseHeader, PreviewMode, LinesWereModified);

please change to

            Modify(true);

            if NotOnlyDropShipment then
                if IsUpdateWhseDocumentNecessary(PurchaseHeader) then
                    WhsePurchRelease.Release(PurchaseHeader);

            OnAfterReleasePurchaseDoc(PurchaseHeader, PreviewMode, LinesWereModified);

procedure Reopen

            if Status = Status::Open then
                exit;
            if "Document Type" in ["Document Type"::Order, "Document Type"::"Return Order"] then
                if not SkipWhseRequestOperations then
                    WhsePurchRelease.Reopen(PurchHeader);
            Status := Status::Open;
            OnReopenOnBeforePurchaseHeaderModify(PurchHeader);

please change to

            if Status = Status::Open then
                exit;
            if IsUpdateWhseDocumentNecessary(PurchHeader) then
                WhsePurchRelease.Reopen(PurchHeader);
            Status := Status::Open;
            OnReopenOnBeforePurchaseHeaderModify(PurchHeader);

new procedure and event:

    local procedure IsUpdateWhseDocumentNecessary(PurchHeader: Record "Purchase Header") UpdateWhseDocumentNecessary: Boolean;
    var
        Handled: Boolean;
    begin
        UpdateWhseDocumentNecessary := false;

        OnBeforeIsUpdateWhseDocumentNecessary(PurchHeader, UpdateWhseDocumentNecessary, Handled);
        if Handled then
            exit(UpdateWhseDocumentNecessary);

        if PurchHeader."Document Type" in [PurchHeader."Document Type"::Order, PurchHeader."Document Type"::"Return Order"] then
            if not SkipWhseRequestOperations then
                UpdateWhseDocumentNecessary := true;
    end;

    [IntegrationEvent(false, false)]
    local procedure OnBeforeIsUpdateWhseDocumentNecessary(PurchHeader: Record "Purchase Header"; var UpdateWhseDocumentNecessary:Boolean; var Handled:Boolean)
    begin
    end;

please make these changes in "Release Sales Document" and "Release Purchase Document".
thank you in advance

@AlexanderYakunin AlexanderYakunin added the event-request Request for adding an event label Apr 3, 2023
@BernhardKloibmueller
Copy link
Contributor Author

Same change now in Release Service Document necessary. Release Service Document will be updated in BC 22.2 as I got the information from Support.

@AlexanderYakunin
Copy link
Contributor

I am looking into old issues. Do you still need this, as we have SkipWhseRequestOperations variable and you can set it to skip Warehouse Release?

@BernhardKloibmueller
Copy link
Contributor Author

I am looking into old issues. Do you still need this, as we have SkipWhseRequestOperations variable and you can set it to skip Warehouse Release?

Yes in Release Service Document there is no possibility to set SkipWhseRequestOperations.
So at least in Service it is needed. sales and purchase is in the meantime sufficiently extended.

@JesperSchulz JesperSchulz added the SCM GitHub request for SCM area label Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
event-request Request for adding an event SCM GitHub request for SCM area
Projects
None yet
Development

No branches or pull requests

3 participants