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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

Enable custom menu item added at Salestablelistpage form under generate control section

(0) ShareShare
ReportReport
Posted on by

Hi,

In salestablelistpage form generate control, I have added a custom menu item.

I want this particular menu item to be enabled always as i want user to use it while SO is journal type  , however it appears that this generate tab items are enabled only after cetrain conditions are met.

Please suggest a fix.

Thanks

Mav

I have the same question (0)
  • Suggested answer
    Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Mav,

    The enabling/disabling of this button group is being controlled by SalesTableListPageInteraction class. You can can check setButtonSellMutliSelection method in this class which is enabling/disabling this button group.

    pastedimage1616800739925v1.png

    You can create a CoC on this method and enable the button group as per your requirements.

  • Mav Profile Picture
    on at

    I think that is for entire generate control,  i want the generate to work as it is , just want to enable my action item always.

    Thanks

    Mav

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

    Hi Mav,

    Since the button you added is under Generate, if the Generate button group is disabled, this button will be disabled as well. You will need to enable the button group and disabled the other buttons under this group.

    It might be easier if you can create a new button group and place your menu item button under it.

  • Suggested answer
    André Arnaud de Calavon Profile Picture
    303,730 Super User 2026 Season 1 on at

    Hi Mav,

    You can or move the button to another position on the form or check if there is coding which will disable the whole submenu. If that is the case, you can extend it to enable the submenu and disable individual menu items.

  • Mav Profile Picture
    on at

    Hi Experts,

    If it is that complicated then I will let it work just like oob.so my custom button will be disabled when generate is disabled and vica versa.


    How can I get it to work just like other buttons in salestableform which is the underlying form. for example confirmation button. If that is enabled my custom button is enabled and if that is Disabled then my custom button is disabled.

    Asking because in this form the issue I m facing is that when oob button is disabled my custom is enabled and I would want it to just mimic the oob behavior.

    Thanks

    Mav

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

    Hi Mav,

    If you are looking to enable disable the button on SalesTable form, you can do this by creating a CoC on method applyState in class SalesTableFormJournalButtonState and add the condition for your enabling/disabling your button based on the value of enableConfirmationButton.

    pastedimage1616855870298v1.png

  • Mav Profile Picture
    on at

    Yep  i saw that switch case, i guess the COC on this method will take care of both salestable & salestablelistpage as this switch statement has cases for both those forms.

    Can you please share how to do COC in existing switch case where it would replicate the behavior of enableConfirmationButton.

    pastedimage1616864918913v3.png

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

    Hi Mav,

    That's correct. This will take care of both SalesTable and SalesTableListPage forms. You can try doing CoC on this method like this -

    [ExtensionOf(classStr(SalesTableFormJournalButtonState))]
    public final class DEVSalesTableFormJournalButtonState_Extension
    {
        public void applyState()
        {
            next applyState();
            
            switch (this.parmFormRun().name())
            {
                case formStr(SalesTable):
                    this.enableButton(formControlStr(SalesTable, yourButton), enableConfirmationButton);
                    break;
                    
                case formStr(SalesTableListPage):
                    this.enableButton(formControlStr(SalesTableListPage, yourButton), enableConfirmationButton);
                    break;
            }
        }
    }
    

  • Mav Profile Picture
    on at

    Hi Gunjan,

    Wow i did not know that , that you can just add a condition into existing Case for COC. Thanks.

    Can you please share how do i get the below salestable in the switch case and add additional  logic like below

    switch casse

    Mimics the existing confirm button behavior to custom button and additionaly below condition

    if (salestable.order type == journal) then keep the button enable.

    Thanks

    Mav

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

    Hi Mav,

    You can check if you have the variable salesTable available in the class in which case you can use it directly.

    Else you can try this code -

    [ExtensionOf(classStr(SalesTableFormJournalButtonState))]
    public final class DEVSalesTableFormJournalButtonState_Extension
    {
        public void applyState()
        {
            SalesTable salesTableLoc;
            
            next applyState();
            
            salesTableLoc = this.parmFormRun().datasource("SalesTable").cursor();
            
            if (salesTableLoc.SalesType != SalesType::Journal)
            {
                switch (this.parmFormRun().name())
                {
                    case formStr(SalesTable):
                        this.enableButton(formControlStr(SalesTable, yourButton), enableConfirmationButton);
                        break;
                        
                    case formStr(SalesTableListPage):
                        this.enableButton(formControlStr(SalesTableListPage, yourButton), enableConfirmationButton);
                        break;
                }
            }
        }
    }

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

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

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 663

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 439 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 337 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans