Neil McDonald's Dynamics 365 Blog

Posts Tagged ‘javascript

Hide tabs and disable fields based on user roles

leave a comment »

The below is a way to hide a tab to everyone not in the Account Manager and System Administrator roles. There’s also a slightly less polished method to disable fields to everyone not in the System Administrator role.

You should be able to copy and paste the below script into your OnLoad event and change the bottom 2 lines of code to specify the tab you want to hide. It wil then hide it from everyone not in the roles specified. You’ll also have to change the attribute names which you want to disable in the HideField function.

Read the rest of this entry »

Written by neilmcd

Jul 8, 2010 at 6:58 pm

Posted in CRM 4

Tagged with , ,

Google Maps in CRM

leave a comment »


I wanted a quick way of viewing an Account’s location so I created a link to Google maps based on the postcode of the Account.

First of all, create an nvarchar/URL attribute called new_googlemaps, stick it somewhere on your Account form and then put the below javascript into the Account OnLoad event

crmForm.all.new_googlemaps.DataValue = “”+crmForm.all.address1_postalcode.DataValue;

It’s pretty basic but does exactly what I want. I’m going to look at embedding the actual map in an iframe when I get the chance

Edit: it turns out that Richard Knudson has covered embedding maps already on his site!

Written by neilmcd

Jul 5, 2010 at 10:27 pm

Posted in CRM 4

Tagged with ,