How to disable system defined edit button in standard form of d365?
How to disable system defined edit button in standard form of d365?
Hi vikash_ ,
You can read the link shared by Sukrut, where it mentions "if a form should always be in Edit mode or should always be in View mode, you can use the ViewEditMode property to achieve that effect, and the buttons won't appear on the form"
For view mode, None of these buttons (Edit, Done, Save, and Restore) are shown, because the framework assumes that they aren't needed.
https://axbloggerblog.blogspot.com/2017/04/d365fo-change-view-edit-mode-of-form.html
FormRun formRun = sender; FormRunViewEditModeHelper viewEditModeHelper = formRun.viewEditModeHelper(); viewEditModeHelper.setViewEditModer(ViewEditMode::View);
If you are looking for x code then take a look at below standard documentation and code
FormCommandButtonControl attachButton; public void init() { #SysSystemDefinedButtons super(); attachButton= this.control(this.controlId(#SystemDefinedAttachButton)) as FormCommandButtonControl; attachButton.visible(false); }
Hi Vikash,
Is your question related to security permissions or do you want to disable editing records based on certain conditions using x++ coding?
moved to the d365 forum
You can disable a user editing a records in a form by defining the proper permissions.
Take a look on docs.microsoft.com/.../role-based-security
André Arnaud de Cal...
294,157
Super User 2025 Season 1
Martin Dráb
232,930
Most Valuable Professional
nmaenpaa
101,158
Moderator