Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Disable menu item button when multiple records are selected

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have the following situation:

One table is datasourse of the form. The same table has one 'NoYesCombobox' field which is showing on the form's grid. Also on the form, there is one Action menu item button.

When multiple records on the form are selected, if one of the value of the selected records of the 'NoYesCombobox' is NO the Action menu item button should be disabled and an error message should appear.

Otherwise if all of them are Yes, it should be enabled and do another logic.

So, I tried to solve this with overriding the active method of the form datasource and put the condition:

if (condition)

{

actionMenuItemButton.enabed(false);

}

But, with this if one of the value of the 'NoYesCombobox' No, and others are Yes, it still enables the button.

Is there any other solution for this?

Thanks in advance.

*This post is locked for comments

  • Verified answer
    André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,885 Super User 2024 Season 2 on at
    RE: Disable menu item button when multiple records are selected

    Hi Butterfly12345,

    When you select multiple records, the contents are not evaluated. The most easy solutions are provided above. I don't know if there are methods to catch when records are selected and then interact with the result. If there is an option, I would not like to use it. Imagine a user can select all records, then the form will be freezing to evaluate if a button should be active or not. So, I would suggest to use one of the suggestions provided in my previous answer to prevent form freezing which would be a performance issue in the view of the user.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Disable menu item button when multiple records are selected

    Yes, that property is set to Yes.

    As I said,When multiple records on the form are selected, if one of the value of the selected records of the 'NoYesCombobox' is NO the Action menu item button should be disabled , but it is not.

  • Suggested answer
    André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,885 Super User 2024 Season 2 on at
    RE: Disable menu item button when multiple records are selected

    Hi Butterfly12345,

    There is a property on the form menu item called 'MultiSelect'. You can set this to no. Then only one record can be selected for the menu item. If you need more records selected, then you can consider adding a condition in the logic with help of x++ coding to skip actions based on the 'NoYesCombobox' value.

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey Pt 2

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,885 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,569 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans