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

Delete button in form should only be activated for users with sysadmin

(0) ShareShare
ReportReport
Posted on by 668

Hi,

I have been working with standard form, where I want to enable/disable the delete button for specific users.

As it is just a property, so I'm unable to do it.

Please guide me to achieve this functionality.

Thanks in Advance!!

I have the same question (0)
  • Suggested answer
    GirishS Profile Picture
    27,827 Moderator on at
    RE: Delete button in form should only be activated for users with sysadmin

    Hi,

    You can achieve these using securities.

    You can create new privilege - Add the menu item to entry point and set the access level to "Create".

    Later you can assign that privilege to duty and then duty to role.

    Finally, you can assign that role to particular user.

    Thanks,

    Girish S.

  • Suggested answer
    Mohit Rampal Profile Picture
    12,565 Moderator on at
    RE: Delete button in form should only be activated for users with sysadmin

    Hi, One way is to use User Groups and enable/disable delete button based on if current user exists in user group.

    Also you can check this thread for another Verified solution for Command Delete button.

    community.dynamics.com/.../delete-button-permissions

  • D365FO Avatar Profile Picture
    668 on at
    RE: Delete button in form should only be activated for users with sysadmin

    Hi Girish,

    I have to disable/ enable the delete button of all projects, as I have checked there are 2 forms are involved one is  ProjProjectsListPage and another is Projtable.

    If I check ProjProjectsListPage, a FormCommandButtonControl is used for Delete button that can be diable/ enable by security privilege.

    But ProjTable, delete button is controlled through ProjTable datasource property "Allow Delete".

    So I'm not sure how to achieve this functionality in projTable

  • D365FO Avatar Profile Picture
    668 on at
    RE: Delete button in form should only be activated for users with sysadmin

    Hi Mohit,

    As per my above comment, you may have understood my problem.

    Could you please explain me how can I use User groups? It is possible for achieving in ProjTable?  

  • GirishS Profile Picture
    27,827 Moderator on at
    RE: Delete button in form should only be activated for users with sysadmin

    As I mentioned you can create one privilege and add both the forms to the entry points - Set the access Level to "Create". Create new Duty and assign the privilege to duty - Create new role and assign the duty to the role.

    If you have existing duty or role, you can directly add them.

    You can then assign the roles to the user and check.

    Thanks,

    Girish S.

  • D365FO Avatar Profile Picture
    668 on at
    RE: Delete button in form should only be activated for users with sysadmin

    Yes, I have achieved functionality by these steps for ProjProjectsListPage where FormCommandButton control is there.

    but for ProjTable, where there is no FormCommandButton , it is not working.

    Please let me know the work around for  disabling/ Enabling Delete button in ProjTable form.

  • Suggested answer
    Mohit Rampal Profile Picture
    12,565 Moderator on at
    RE: Delete button in form should only be activated for users with sysadmin

    Hi, Idea is to create a new user group in System Administration module. Assign users to this user group and in the code check if current user exists in the user group then Delete button is Enabled otherwise disabled.

    You can get user group tables involved from this article

    https://wp.me/p9sJlS-W

    Yes, It's possible for both listpage and details form (projTable) because it's not dependent on menu item or button.

    And I would suggest to use this only if your requirement is not achieved by security privileges. 

  • GirishS Profile Picture
    27,827 Moderator on at
    RE: Delete button in form should only be activated for users with sysadmin

    It should work - Refer to the role "Project Supervisor" - It has the duty assigned as "ProProjectMasterInquire" - Privilege will be "ProjTableView".

    ProjTableView privilege has "ProjTable" and it has Read acces only.

    Assing "Project Supervisor" role to user and check - Both New and Delete button will be disabled in list page and details form. For your scenario it will be Create access.

    Compare with the standard security role and check.

    Thanks,

    Girish S,

  • D365FO Avatar Profile Picture
    668 on at
    RE: Delete button in form should only be activated for users with sysadmin

    pastedimage1677848847593v1.png

    Can you please check I have created this privilege as you mentioned, before that the grant access was Delete, now I have changed it with Create. Is It fine?

  • GirishS Profile Picture
    27,827 Moderator on at
    RE: Delete button in form should only be activated for users with sysadmin

    Yes it must be Create access.

    Assign the role to user and check.

    You can drag and drop the ProjTable menu item to Entry point reference node and on the property set the access level to Create.

    Thanks,

    Girish S.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 683 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 398 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans