Hiding empty section on form in CRM 4.0

To hide a section where it has one or more attributes in it we can sue javascript code below to hide section

crmForm.all.myfieldid.parentElement.parentElement.parentElement.parentElement.style.display = “none”;

However in case where we have a section which is being used only to display a label i.e. name on the form and it does not have an attribute in it then above code will not work.

Using developer tool in IE (or any other browser) we can find ID of the section and then use code below to hide it

document.getElementById(“{3f33ca32-f2c3-e411-b01d-0050569d5cbc}”).style.display = “none”;

To display it again we can just replace ‘none’ with ‘block’ and section will start appearing.

Comments are closed.