Notifications
Announcements
No record found.
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
You can need to create a onActivated" event handler for datasource in form. There you can control visibility of a control.
Thanks.
But how does it work? which class should i call to know whether sales order is confirmed or not.
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));
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.
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.
Shariq,
Which version of D3FO are you on?
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; } }
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 WriceSR Support EngineerDynamics 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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 559 Most Valuable Professional
André Arnaud de Cal... 464 Super User 2025 Season 2
Sohaib Cheema 250 User Group Leader