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

Community site session details

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

To disable the action menuitem button on click of button for current record

(1) ShareShare
ReportReport
Posted on by 1,803
Hi
Everyone ,
 
I have create the action menuitem button on the form and i want it to disable on click for first record and also want to make all  the fields on the form non editable and the buttons on the grid should also get disable and no new  record should be created on line grid if the menuitem button is disable. can you guys help me how can i get this done.
 
thanks 
I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    297,322 Super User 2025 Season 2 on at
    To disable the action menuitem button on click of button for current record
    Hi Dinesh,

    Martin provided already valuable information on places where to set coding to control the editability of data sources and form controls.
    In addition, can you clarify with what condition the action menu item button should be disabled? Are you doing this as part of security configuration?
  • Suggested answer
    Martin Dráb Profile Picture
    235,888 Most Valuable Professional on at
    To disable the action menuitem button on click of button for current record
    You can react to selected of a record by overriding or extending active() method of the data source (or to subscribe to the corresponding event). Or, if you want it on a button click, you can override clicked() method (or use an event). One more option is using a menu item button pointing to a class.
     
    There you can use enabled() method of buttons or other controls, allowEdit() method of data sources and allowCreate() method of the line data source. You'll pass false to them.
     
    Don't try to do everything at once. Pick one of the scenario, such as making lines non-editable, and implement this one when. When you're able to do this simple thing, add the other cases.

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…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

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

#1
Sohaib Cheema Profile Picture

Sohaib Cheema 764 User Group Leader

#2
Martin Dráb Profile Picture

Martin Dráb 619 Most Valuable Professional

#3
André Arnaud de Calavon Profile Picture

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

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans