Home > MS CRM 4.0 > Hide/Show CRM form fields and sections

Hide/Show CRM form fields and sections


 
Hide/Show CRM form fields/sections are the common requirement in many organization.The solution for this is very simple.
 
CRM Form Types:
 
There are 7 crmForm types

Undefined= 0

CreateForm = 1

UpdateForm = 2

ReadOnlyForm = 3

DisabledForm = 4

QuickCreateForm = 5

BulkEditForm = 6

You set this vaules as enum in javascript as follows

var FormTypes= {"Undefined" : 0, "CreateForm " : 1, "UpdateForm " : 2, "ReadOnlyForm " : 3, "DisabledForm " : 4, "QuickCreateForm " : 5, "BulkEditForm " : 6};

So it will be very easy to compare form type

If(crmForm.Type == FormTypes.CreateForm )

{

// Do your work here

Hiding Section in CRM form

//Hide the Second Section in the first Tab  
  ToggleSection( 0 , 1 , "none");  

// Tabs and Section Collections are zero based  
function ToggleSection( tabIndex , sectionIndex , displayType )  
{  
  var sec = document.getElementById( "tab" + tabIndex );  
  sec.childNodes[0].rows[ sectionIndex ].style.display = displayType;  
}

Hiding CRM Form Fields

crmForm.all.<name of the field > .style.display = ‘none’;

To show

crmForm.all.<name of the field > .style.display = ‘block’;//Hide the Second Section in the first Tab  
  ToggleSection( 0 , 1 , "none");  

// Tabs and Section Collections are zero based  
function ToggleSection( tabIndex , sectionIndex , displayType )  
{  
  var sec = document.getElementById( "tab" + tabIndex );  
  sec.childNodes[0].rows[ sectionIndex ].style.display = displayType;  
}
 
 
Advertisements
Categories: MS CRM 4.0
  1. No comments yet.
  1. No trackbacks yet.

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

%d bloggers like this: