Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Sales forum / Editable Grid for roles
Sales forum
Suggested answer

Editable Grid for roles

Posted on by 22
Hi All
 
I would like to setup that some of user can use Editable Grid, and another user cannot use in same form. Can I setup it in Dynamics 365 for Sale?
 
Thanks 
 
  • Suggested answer
    Leah Ju Profile Picture
    Leah Ju Microsoft Employee on at
    Editable Grid for roles
    Hi partner,
    Roles? Do you mean security roles?
    Maybe you can create two sub-grids in the same form, one is editable gird, another is read-only grid.
    Then you can use js code to show or hide them based on current user's security role.
    1.Check security soles of current user:
     // Get User Roles
        const userRoles = Xrm.Utility.getGlobalContext().userSettings.roles;
    2.Hide or show sub-grid:
    formContext.getControl(‘Subgrid_consultations’).setVisible(false);//Hide Subgrid
    ormContext.getControl(‘Subgrid_consultations’).setVisible(true);//Show Subgrid
    https://dynatecon.com/2022/05/04/show-and-hide-subgrid-based-on-field-value-using-javascript-in-ms-dynamics-365-crm/
    I hope you can verify my answer if it helps you! If you have any questions, please feel free to contact me.
    Regards,
    Leah

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,246 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,041 Super User 2024 Season 2

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans