*This post is locked for comments
*This post is locked for comments
I am using Dynamics 365 v9.0 and have to hide/show few fields (ranging from 2 to 10) on Case form based on user's security role.
Creating different forms will be confusing for users as they will have different roles (means access to different forms). Hence, creating Case # 1 with Form#1 then creating Case #2 with Form#2. Now opening Case#1 it will open in Form#2 and they will have to remember and manually changed it to Form#1 to see those specific fields. Not a great user experience!
Finally, I am creating just one Case Form. Providing one options set which gets filtered based on user's security role (using JavaScript). User selects a value from this option set and based on selected value, I am using Business Rules to show/hide fields on form.
Hi Athar,
As you mention above and Goutam recommended below there are two options.
Using JavaScript or Form based Security Roles is your option.
I would say you have to consider a solution based on the amount of separate customizations that you have on the form.
If you have very few differences between one security role and the next, you can use JavaScript.
If your forms are quite different, then definitely use the approach of multiple forms.
I am not sure which version of Dynamics CRM Online you are on, but if you are on version 9, you should consider the following.
If the reason for displaying different forms is different organizational roles, you might also consider using apps.
This will allow you creating different applications in where different organizational units will only see their portion of the application. For examples you would have an application for Sales and an application for Service (as already available out of the box). Of course this will be using the new Unified Interface and not the standard interface.
Hope this helps.
Hello ,
You are correct. Following are the way you can hide fields ,form , form sections tab in dynamics 365.
- You can show /hide fields in Dynamics CRM using JavaScript , Business rules , Field level security.
- To hide particular form in an entity you need to implement role based forms or using security roles.
- To hide any form section and tab inside the form you can write javascript code.
Now lets come to your scenario.
1) Use JavaScript to fetch User’s security role and based on that show/hide specific fields on form.
This is not a good idea , if you have few fields to hide then you can implement field level security profile in Dynamics 365. Assign those security profile to user and team to restrict the user. You can check below article -
www.encorebusiness.com/.../microsoft-dynamics-crm-field-level-security
If there is a condition or you need to hide fields depends on another field value then you can implement business rule to hide fields in same forms. You can check below article for business rules -
docs.microsoft.com/.../create-business-rules-recommendations-apply-logic-form
2) Create separate forms and Enable Security Roles on forms which will provide only applicable forms to users.
Exactly same features you can achieve by using role based forms. You can have multiple forms for your entity . You can show hide those entity by applying particular security role. You can have multiple security roles for same different different form and assign multiple security roles to same user to show multiple form.
Here is reference -
community.dynamics.com/.../role-based-forms
I always suggest try to use as much as OOB functionality which you can implement without any code , like business rules , field security profile instead of writing JavaScript code.
Hope this will help you to understand.
Good Luck.
André Arnaud de Cal...
292,884
Super User 2025 Season 1
Martin Dráb
231,762
Most Valuable Professional
nmaenpaa
101,156
Moderator