web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Enable Post packing slip & proforma button on salesorder confirmation d365fo

(0) ShareShare
ReportReport
Posted on by 199

Hi,

I've a scenario where I want to disable the post packing slip when sales order is not confirmed. Once sales order is confirmed post packing slip will be available. 

Anyone knows how would I achieve this using classes? Do suggestion some solutions.

thanks,

Zohan

I have the same question (0)
  • Suggested answer
    nunomaia Profile Picture
    25 Moderator on at

    You can need to create a onActivated" event handler for datasource in form. There you can control visibility of a control.

  • shariqsaleem Profile Picture
    15 on at

    Thanks. 

    But how does it work? which class should i call to know whether sales order is confirmed or not. 

  • Suggested answer
    Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Shariq,

    You can create a CoC for SalesTableFormJournalButtonState class, method "applyState".

    The variable "enableConfirmationButton" is set to true when the order is not confirmed. You can add the following logic -

    this.enableButton(formControlStr(SalesTable, buttonUpdatePackingSlip), (enablePackingSlipButton && !enableConfirmationButton));

  • vinitgoyal2005 Profile Picture
    6,332 on at

    Hi,

    Code is already shared by Gunjan, I just have one more suggestion. Check with your functional consultant if you should also disable invoicing till SO is confirmed.

  • shariqsaleem Profile Picture
    15 on at

    HI,

    i've created a coc for salestableformjournalbuttonstate class & on apply state after calling next i've set the above that you've mentioned.

    but it didnt work. the postpackingslip is still disabled when sales order is confirmed.

  • Gunjan Bhattachayya Profile Picture
    35,423 on at

    Shariq,

    Which version of D3FO are you on?

  • Suggested answer
    Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Shariq,

    I didn't realize that the functionality changed in the latest versions. You are required to generate just one confirmation. Post that even if you make any changes to the sales order, you are not needed to do a new confirmation. You can generate the packing slip without any errors.

    In this scenario, we just need to make sure that the sales order is confirmed when generating the packing slip. I think this code will take care of it -

    public void applyState()
    {
        SalesTable salesTable;
        boolean    isConfirmed; 
        
        next applyState();
    
        switch (this.parmFormRun().name())
        {
            salesTable = this.parmFormRun().dataSource("SalesTable").cursor() as SalesTable;
            isConfirmed = (salesTable.DocumentStatus == DocumentStatus::Confirmation) ? true : false;
    
            case formStr(SalesTable):                                                            
                this.enableButton(formControlStr(SalesTable, buttonUpdatePackingSlip), (enablePackingSlipButton && isConfirmed));
                break;
    
            case formStr(SalesTableListPage):            
                this.enableButton(formControlStr(SalesTable, buttonUpdatePackingSlip), (enablePackingSlipButton && isConfirmed));
                break;
        }
    }

  • Suggested answer
    Marianw Profile Picture
    on at

    Hi Zohan,

    Thank you for using Dynamics 365 Finance Communities.

    There is currently no setup within D365 that disables the Post Packing slip button prior to Sales Order Confirmation without creating a customisation/customising the code.

    There are some great suggestions on this thread on how to achieve this and hopefully this helps you too!

    If your question has been answered, please help to mark this thread as answered.

    Regards,
    Marian Wrice
    SR Support Engineer
    Dynamics 365 Finance

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 559 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 464 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans