Microsoft Dynamics CRM

CHANGE COLOR FOR LOOKUP FIELDS : DYNAMICS CRM 2013

Sometimes we get requirement to change the text colour for some fields in Dynamics CRM 2013 in order to highlight them in different colour. I wrote one for text field but recently got asked to change for Lookup field in a query. I do suggest that it is unsupported, but still as an experiment here it goes:

You can add the scripts on-load or based on some condition.

For changing colour during field is non-selected:

//Setting red colour

$(‘#fieldname’).find(‘span[class=”ms-crm-Lookup-Item-Read”]’).css(‘color’,color);

Now Lookup Field looks like this:

clip_image002

Note: This is unsupported script and may break in future if Microsoft changes something.

Hope it helps!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s