{Tips &Tricks} Add borders to fields on form in Dynamics CRM 2013

We upgraded recently to Dynamics CRM 2013 and after upgrade one of the feedbacks that came from our customer was that when the form loads for this first time, the fields are clearly not distinguishable. Off course they were talking about the new feature in Dynamics CRM 2013 where the controls are highlighted on the form only when when the field is selected. We tried to make them understand this behavior of CRM 2013 but they were kind of adamant to highlight the fields. Hence we had not option but to resort to the jQuery customizations. The following is the code we wrote on load of the form. We had to choose a different color. However for this blog i have put the code which would highlight the fields with red border.

var attrs = Xrm.Page.data.entity.attributes.get();
for (var i = 0; i < attrs.length; i++) {
var id = attrs[i].getName();
$(“#” + id).find(“.ms-crm-Inline-Value”).css(“border”, “solid 1px red”);

Hope this helps!

Author: Debajit

I am a Dynamics CRM Most Valuable Professional (MVP) with 12 years of experience in Microsoft .NET Technologies and 9 years of dedicated experience in Microsoft Dynamics CRM. I have worked with companies like Microsoft, SanDisk, PwC, TMF Group and have extensive experience of implementing complex CRM solutions from both offshore and client side. Currently the face of XrmForYou.com with significant experience in delivering corporate training on Dynamics CRM and have already delivered multiple projects to client through XrmForYou.com Author of multiple tools on codeplex including the 'Role Based Views' and 'CRM-Sharepoint Metadata manager & Attachment Extractor' which are available for commercial use under XrmForYou.com For consulting/ training, drop me a note at info@xrmforyou.com or visit our website www.xrmforyou.com

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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s