Various Ways To Hide/Unhide A Field/Section In CRM

by Bill Owens 22. May 2008 18:49
by Danny Varghese 03.28.08

Intro

When customizing forms in CRM, one of the most commonly used and simplest things to do is a hide a field on the form.  This may be hiding one or numerous fields on the form.  Often times, developers may need to use several “hidden” fields for other purposes.  In this case, he/she could place all those fields in a section on the form, and then hide the section.

Hiding A Field

To hide a field use the following code snippet:

 crmForm.all.<insert schema name of field>_c.style.visibility = ‘hidden’;crmForm.all.<insert schema name of field>_d.style.visibility = ‘hidden’; 

 


OR

crmForm.all.<insert schema name of field>_c.style.display = ‘none’;crmForm.all.<insert schema name of field>_d.style.display = ‘none’; 

You will have to hide both the “_c” and “_d” parts of the field.  The “_c” appended to the field is the label of the field, and “_d” is the data contained in the field.

Un-hiding A Field 

To un-hide a field, use the following code snippet:

crmForm.all.<insert schema name of field>_c.style.visibility = ‘visible’;

crmForm.all.<insert schema name of field>_d.style.visibility = ‘visible’;

 

OR


 

crmForm.all.<insert schema name of field>_c.style.display = ‘block’;crmForm.all.<insert schema name of field>_d.style.display = ‘block’; 

 


Hiding A Section


 


To hide a section (which will in turn, hide all fields in that section), use the code snippet below:

 crmForm.all.<insert schema name here>. parentElement.parentElement.parentElement.style.display = 'none'; Un-hiding A Section

To un-hide a section, use the code snippet below:


crmForm.all.<insert schema name here>. parentElement.parentElement.parentElement.style.display = 'block';



Tags: ,

CRM 4.0

Page List

About the author

I work for a consulting firm in Dublin Ohio called Affiliated Resource Group. For the last five years I have been spearheading our Microsoft Dynamics CRM practice. I have a deep appreciation for the Microsoft CRM platform and I am very excited about it. You might even describe me as a Microsoft CRM Advocate. I have many battle scars from my experience with the product and I’m constantly being asked questions about CRM and how-to-do something in it. Hence, this BLOG is to help disseminate that knowledge and information to everyone. As of last year I was posting links to many other blogs to help spread the knowledge, but now with the community.dynamics.com doing that for me, I will be following that practice unless a really juicy article catches my eye. Many people have asked where my post are for the first half of 2010, my company had me posting to another blog and maintain two was near impossible. I am now down to just this blog. So good luck and I hope that this blog may help in some way. If you have suggestions or questions, please email me them.

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2012 BillOnCRM