Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Hide form section/tab of CRM portal based on web roles

Posted on by 10

Hi all,

I want to display a particular section on the web page of crm portal based on web roles. For example: if a partner user have web role 1 then he should be abe to edit few attributes of the form on crm portal and for rest it should not be visible.

*This post is locked for comments

  • Suggested answer
    Summer Garg Profile Picture
    Summer Garg 585 on at
    RE: Hide form section/tab of CRM portal based on web roles

    If want to show/hide web pages based on web roles then check this link :

    crmhub.blogspot.in/.../create-new-web-roles-in-Adx-Studio-Portal-D365-Portal.html

  • Suggested answer
    Dmytro Rutkovskyi Profile Picture
    Dmytro Rutkovskyi 1,835 on at
    RE: Hide form section/tab of CRM portal based on web roles

    The most secure way will be introducing two forms and put them on different pages, and use web roles to limit access to that pages for different users.

    But if you just want to hide something on the form, and don't care if they can see it in the code - then you can just put your form on Page which has custom Page template of Wevtemplate type. And in webtemplate you can use liquid to get current user role (something like):

    {% assign is_hiderole = user | has_role: 'specific role name' %}
    <script>
    
    {% if is_hiderole %}
    $(document).ready(function() {
       // hide attribute 
      $("#attribute_name_to_hide").closest("tr").hide();
       // hide section
      $("#section_id_tohide").hide();
    });
    {%endif%}
    
    </script>






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,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans