Skip to main content

Notifications

Announcements

No record found.

Business Central forum
Answered

Removing Cancel button while posting Sales Order

Posted on by 221
Dear experts,
I have to Remove cancel button when user clieck on post then ship and invoice then while posting one dialog box window shows processing and entries posting this also has cancel buttton i need to Remove this button so that no user can cancel posting can anyone help Thanks in advance please find Following SS for Ref.
 
Categories:
  • DineshM Profile Picture
    DineshM 221 on at
    Removing Cancel button while posting Sales Order
    Thank you for Responce.@Kamal Khakhkhar,@TeddyH ,@YUN ZHU and blog for same @KasparsSemjonovs.

    Got Solution 
  • Verified answer
    TeddyH Profile Picture
    TeddyH 12,861 Moderator on at
    Removing Cancel button while posting Sales Order
    You should use HideProgressWindow=True because you want to hide the progress window.
  • Verified answer
    YUN ZHU Profile Picture
    YUN ZHU 68,536 Super User 2024 Season 2 on at
    Removing Cancel button while posting Sales Order
    Hi, KasparsSemjonovs is right, I've tested it.
     
    Hope this helps.
    Thanks.
    ZHU
  • Verified answer
    KasparsSemjonovs Profile Picture
    KasparsSemjonovs 3,660 Super User 2024 Season 2 on at
    Removing Cancel button while posting Sales Order
    From the logic I would say HideProgressWindow=True;  would indicate that You want to hide the progress window... 
    but I am not a developer, and haven't used this myself.
  • DineshM Profile Picture
    DineshM 221 on at
    Removing Cancel button while posting Sales Order
    Hi 
    I have tried following Event but not working
    codeunit 50008 "All sub"
    {
        [EventSubscriber(ObjectType::Codeunit, Codeunit::"Sales-Post", 'OnBeforePostATO', '', false, false)]
        local procedure OnBeforePostATO(SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; var TempPostedATOLink: Record "Posted Assemble-to-Order Link" temporary; var AsmPost: Codeunit "Assembly-Post"; var ItemJnlPostLine: Codeunit "Item Jnl.-Post Line"; var ResJnlPostLine: Codeunit "Res. Jnl.-Post Line"; var WhseJnlPostLine: Codeunit "Whse. Jnl.-Register Line"; HideProgressWindow: Boolean; var IsHandled: Boolean)
        begin
            HideProgressWindow := false;
        end;
     
        [EventSubscriber(ObjectType::Codeunit, Codeunit::"Sales-Post", 'OnBeforePostSalesDoc', '', false, false)]
        local procedure OnBeforePostSalesDoc(var SalesHeader: Record "Sales Header"; CommitIsSuppressed: Boolean; PreviewMode: Boolean; var HideProgressWindow: Boolean)
        begin
            HideProgressWindow := false;
        end;
     
        [EventSubscriber(ObjectType::Codeunit, Codeunit::"Sales-Post", 'OnBeforeInitPostATO', '', false, false)]
        local procedure OnBeforeInitPostATO(SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; var AsmPost: Codeunit "Assembly-Post"; HideProgressWindow: Boolean; var IsHandled: Boolean)
        begin
            HideProgressWindow := false;
        end;
     
    }
  • Kamal Khakhkhar Profile Picture
    Kamal Khakhkhar 255 on at
    Removing Cancel button while posting Sales Order
    Hii there,
    as per your requirement you need to add code on event of "codeunit 80 "Sales-Post"-> OnBeforeInitPostATO" you need to pass HideProgressWindow=False; as per below.
     
    [EventSubscriber(ObjectType::Codeunit, Codeunit::"Sales-Post", 'OnBeforeInitPostATO', '', false, false)]
    local procedure OnBeforeInitPostATO(HideProgressWindow: Boolean; SalesHeader: Record "Sales Header"; var AsmPost: Codeunit "Assembly-Post"; var IsHandled: Boolean; var SalesLine: Record "Sales Line")
     
    begin
    HideProgressWindow := false;
    end;
     
    If You get your answer , Mark it answered.
    Thank You,
    Kamal Khakhkhar.

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,277 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,135 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans