Tuesday, August 21, 2018

Hide Navigation Menu in Dynamic 365 CRM


One of the most critical factor of choosing any CRM is user experience. Microsoft Team is continuously updating and coming up with great look and feel to make an awesome user experience especially with UI.

However, some factors needs to be taken care by the developer or consultant who is customizing Dynamic CRM for business. Today I am here with such an interesting topic.

! ! ! J ----- So many menu option ------ J ! ! !



Yes, you might have guess it correct what I am trying to convey here.  

We have different people in the organization with different role and people may belongs to various departments. A Classic example would be that few people are from Sales Department and few from Marketing. Marketing people do not want to see items, that belongs to Sales department. Moreover, a sales person may not be interested in the item which comes under Settings and that are exclusively for a CRM administrator to deal with.

To hide specific area/subarea we need to play around with:

User Security Role
+
Sitemap Area Privilege
+
A Custom Dummy Entity (optional - can be achieved with standard entity).

Guidelines to write good JavaScript code in Microsoft Dynamic CRM

https://vjcity.blogspot.com/2019/08/guidelines-to-write-good-javascript.html

Jumping on CRM Practical


Step ~1 
Create a dummy entity HideNavigationItem


Step ~2 
Decide on which security role that need to be adjusted so that users, which comes under that security role, will not see specific Area or Sub Area. 
I am considering Salesperson role here. 
I would enable only Read Privilege for HideNaivagtionItem Entity for Salesperson security role.




Step ~3 
Updating the Sitemap to hide specific area.
First, make a test solution and add only sitemap to it
Export the solution and we will edit the file customization.xml accordingly.



Search for <Area Id=Settings” ResourceId=Area_Settings

and then add:
 <Privilege Entity="new_hidenavigationitem" Privilege="Read" />



I have kept the setting only for subarea = Product Catalog to check what will be the effect of this.


Let’s play more hide n seek game with site map menu items.

In Order to hide complete Business Group under the setting Area, we have to apply our Privilege tag to each sub area as highlighted in below image.






Note :
  • We can also achieve above logic by making use of an existing entity and using a different privilege.
For an example
 <Privilege Entity="case" Privilege="Create" />

  • We are allowed to add tag only under and once all subarea are hidden, only then a Group can be hidden accordingly.


I wonder if such settings would be available in some tools soon.

Thanks.
Vipin Jaiswal

10 comments:

shivansh said...

Great work

Hashendra said...

I have a problem why this is not working when we not checked the Navigation entity security role permission

2. I did the scenario as per the example, The expeced output comes but, in testing phase they found pretty wired scenario.

Hashendra said...

My question: and how to re generate.

1. Log in with user that privileges had changed,
2. Then log in with another user that having other system role,
3. The new log in screen also appear old hide navigation panels.
4. I need new user to load his own navigation accoording to his navigation.
5. My problem is customized navigation not changed after we logged in from another user.


(Hope you get my question.)

Could you please advice me how to solve this problem.




Vipin Jaiswal said...

Hi Darshana,

Can you try your scenario in the In-Private (or inCognito) session. It may be still caching up some web-resources.

Seems to be weird, but let me know what you getting after working in Private session mode.

Vipin Jaiswal said...

Trying to understand that

- You first logged in using a Market Admin Role - Menu option not present (Ideal Scenario).

- You changed the Role to Sales Representative (I hope we changed it from some other machine or session)

- You then logged off as Market Admin Role

n and then when you trying to logged in from Sales Representative role - you observe menu option which should be hidden.

or

you logged In again as Market Admin and observe the menu option.

Vipin Jaiswal said...

Hi Darshana,

Can you post your customization.xml, where you might have done some alteration ?

Hashendra said...

- You first logged in using a Market Admin Role - Menu option not present (Ideal Scenario).
-(Darshana)- Yes my hiding is working perfect for Market Admin role.

- You changed the Role to Sales Representative (I hope we changed it from some other machine or session)
-(Darshana)- Yes I have another sandbox which I can login as System Administrator and I changed the respective users role to Sales Manager(which has different navigation). Then I logged from Sales manager, but still I can see Market Admins navigation panel.
Hint: If I login as System Administrator them all the navigation menu is showing as expected.
Note- This problem is visible roles between System Administrator and Market Admin.


- You then logged off as Market Admin Role

Hashendra said...

Hi Vipan

In you blog post article in Step ~2 , Why did you keep all the permissions blank for HideNavigationItem Custom Entity?

I believe a risk involves here, because it can be assigned to other roles also.
(Why? in other roles also this HideNavigationItem is blank.)

Hope you get what I mean.
I would like to hear thought on this.


Thank you,
Vipan.

Hashendra said...

HI Vipan.

Can you make sure this process will not effect for other Security roles?

Regards
Hashendra

Vipin Jaiswal said...

Hi Hashendra,

I have updated the blog by removing all permissions for HideNavigationItem entity and making it only to Read Privilege.

Thank you for correcting error there :)