Tags

, , ,

Hello Everyone,

Today I faced yet again a challenge while doing some customizations. I had a requirement where I was suppose to show/hide few fields on select of a DropDown.

I knew its quite easy as the following JScript will Show/Hide the fields.

Xrm.Page.ui.controls.get("fieldname").setVisible(true/false);

But the challenge came when I even had to compensate the Spaces created after hiding the fields.

I tried various other options as well but in vain.

Finally after various tryout ; one of the code which I used earlier during my CRM 4.0 implementation worked !!!

crmForm.all.fieldName_c.style.display = 'none';
crmForm.all.fieldName_d.style.display = 'none';

where:

_c extension specifies the “Label” of the field.
_d extension specifies the “Data (textbox)” of the field.

  • Another way around is to add the fields in a section and hide the section itself.
Xrm.Page.ui.tabs.get("TabName").sections.get("SectionName").setVisible(false);
  • Just for reference:- (Jscript to hide Tab)
Xrm.Page.ui.tabs.get("TabName").setVisible(false);

 

Hope that was Helpful.

Thanks!!!

😀

Advertisements