Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Security Roles

Posted on by 932

How can i assign the security roles of any fields, section, tab and form of any entity according to specific users?

*This post is locked for comments

  • Suggested answer
    Shahbaaz Ansari Profile Picture
    Shahbaaz Ansari 6,203 on at
    RE: Security Roles

    Try with the below code for hiding section

    Show a section

    Xrm.Page.ui.tabs.get(“tabname”).sections.get(“sectioname”).setVisible(true);

    Hide a section

    Xrm.Page.ui.tabs.get(“tabname”).sections.get(“sectioname”).setVisible(false);

  • RE: Security Roles

    Thanks, btw i am just asking that same code is used to hide and show the section?

  • Suggested answer
    Shahbaaz Ansari Profile Picture
    Shahbaaz Ansari 6,203 on at
    RE: Security Roles

    You have to use the same code just you need to check in if and else condition for the security role and hide show the tab accordingly

    False to hide and true to show the tab

    Xrm.Page.ui.tabs.get("DETAILS_TAB").setVisible(false)// to hide

    Xrm.Page.ui.tabs.get("DETAILS_TAB").setVisible(true)// to show

  • RE: Security Roles

    Thanks Shahbaaz,

    Appreciate with your answer and if i want to hide section then same way is need or there is different way to hide section?

  • Suggested answer
    Shahbaaz Ansari Profile Picture
    Shahbaaz Ansari 6,203 on at
    RE: Security Roles

    Please check this link for remove {} from guide, it will solve your problem

    community.dynamics.com/.../242420

  • RE: Security Roles

    What is the use of slice function in userId var?

  • RE: Security Roles

    Unti.png

    When i apply the code it gives an script error and screenshot is attached above then now how can i remove this error? 

  • Suggested answer
    Shahbaaz Ansari Profile Picture
    Shahbaaz Ansari 6,203 on at
    RE: Security Roles

    It will be global admin + system admin who create the trial account.

    Also you can create new users and assign them roles you want from setting

    Regards,

    Shahbaaz

  • RE: Security Roles

    Thanks Shahbaaz,

    Would you please tell me that when i make a trial account in D365 then default role is system administrator or else?

  • Verified answer
    Shahbaaz Ansari Profile Picture
    Shahbaaz Ansari 6,203 on at
    RE: Security Roles

    False to hide and true to show the tab

    Xrm.Page.ui.tabs.get("DETAILS_TAB").setVisible(false)// to hide

    Xrm.Page.ui.tabs.get("DETAILS_TAB").setVisible(true)// to show

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans