microsoft / ALAppExtensions

Repository for collaboration on Microsoft AL application add-on and localization extensions for Microsoft Dynamics 365 Business Central.
MIT License
785 stars 621 forks source link

Page 42 Sales Order PostDocument function external access #5346

Closed bartpattijn closed 4 years ago

bartpattijn commented 4 years ago

In page 42 there is a function "PostDocument" which is only local. we would like to add a button "post&print" and would therefor need acces to this function. is it possible to make this function external?

procedure PostDocument(PostingCodeunitID: Integer; Navigate: Option) var SalesHeader: Record "Sales Header"; LinesInstructionMgt: Codeunit "Lines Instruction Mgt."; InstructionMgt: Codeunit "Instruction Mgt."; begin if ApplicationAreaMgmtFacade.IsFoundationEnabled then LinesInstructionMgt.SalesCheckAllLinesHaveQuantityAssigned(Rec);

    SendToPosting(PostingCodeunitID);

    DocumentIsScheduledForPosting := "Job Queue Status" = "Job Queue Status"::"Scheduled for Posting";
    DocumentIsPosted := (not SalesHeader.Get("Document Type", "No.")) or DocumentIsScheduledForPosting;
    OnPostOnAfterSetDocumentIsPosted(SalesHeader, DocumentIsScheduledForPosting, DocumentIsPosted);

    CurrPage.Update(false);

    if PostingCodeunitID <> CODEUNIT::"Sales-Post (Yes/No)" then
        exit;

    case Navigate of
        NavigateAfterPost::"Posted Document":
            begin
                if InstructionMgt.IsEnabled(InstructionMgt.ShowPostedConfirmationMessageCode) then
                    ShowPostedConfirmationMessage;

                if DocumentIsScheduledForPosting then
                    CurrPage.Close();
            end;
        NavigateAfterPost::"New Document":
            if DocumentIsPosted then begin
                Clear(SalesHeader);
                SalesHeader.Init;
                SalesHeader.Validate("Document Type", SalesHeader."Document Type"::Order);
                OnPostOnBeforeSalesHeaderInsert(SalesHeader);
                SalesHeader.Insert(true);
                PAGE.Run(PAGE::"Sales Order", SalesHeader);
            end;
    end;
end;
AlexanderYakunin commented 4 years ago

This functions have been already made external procedure PostDocument(PostingCodeunitID: Integer; Navigate: Option)

bartpattijn commented 4 years ago

This must be released on next CU? Because on BC15 CU2 the procedure is still local:

local procedure PostDocument(PostingCodeunitID: Integer; Navigate: Option) var SalesHeader: Record "Sales Header"; LinesInstructionMgt: Codeunit "Lines Instruction Mgt."; InstructionMgt: Codeunit "Instruction Mgt."; begin if ApplicationAreaMgmtFacade.IsFoundationEnabled then LinesInstructionMgt.SalesCheckAllLinesHaveQuantityAssigned(Rec);

Met vriendelijke groeten,​ [Christiaens] [Christiaens Connect | 18 02 20 | Inschrijven]https://mailchi.mp/christiaens/christiaens-connect-180220 Bart Pattijn ERP Consultant Christiaens NV e: bart.pattijn@christiaens.net t: 0032 51 78 83 83 w: www.christiaens.net a: Passendalestraat 199 B‑8980 Passendale [LinkedIn]https://www.linkedin.com/company/christiaens-nv/ [YouTube]https://www.youtube.com/channel/UCGBiFesfXKF0ErJfSZ1XxvQ [Twitter]https://twitter.com/Christiaens_net [Facebook]https://www.facebook.com/christiaensnv/ [Teamviewer]https://get.teamviewer.com/christiaens

Van: Alexander Yakunin notifications@github.com Verzonden: maandag 13 januari 2020 14:50 Aan: microsoft/ALAppExtensions ALAppExtensions@noreply.github.com CC: Bart Pattijn Bart.Pattijn@christiaens.net; Author author@noreply.github.com Onderwerp: Re: [microsoft/ALAppExtensions] Page 42 Sales Order PostDocument function external access (#5346)

This functions have been already made external procedure PostDocument(PostingCodeunitID: Integer; Navigate: Option)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FALAppExtensions%2Fissues%2F5346%3Femail_source%3Dnotifications%26email_token%3DAK6W6BD3TDBGI7CLOCAVQRLQ5RWQXA5CNFSM4J6RC3ZKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIYYTLQ%23issuecomment-573671854&data=02%7C01%7C%7Cdcfb26cf1abb4e119e8408d7982f7fc5%7C9d73024c188c4cc785f301568b4d323c%7C0%7C0%7C637145202583620356&sdata=kjqkm90%2FJnABXSD1tkFwSyVC9AqprIWYMS1u8DOXHMs%3D&reserved=0, or unsubscribehttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAK6W6BGPAL6BELLPUV2RXCLQ5RWQXANCNFSM4J6RC3ZA&data=02%7C01%7C%7Cdcfb26cf1abb4e119e8408d7982f7fc5%7C9d73024c188c4cc785f301568b4d323c%7C0%7C0%7C637145202583630349&sdata=LeDKe2VKznIKQpz9OkhR%2FmDQgf%2FmZCSyUkilQs2GJNg%3D&reserved=0.