jump to navigation

Hiding multiple tabs based on picklist value in Microsoft CRM 4.0 October 5, 2009

Posted by jarrettexpertcrm in Microsoft CRM General.
Tags: , , , , , , , , ,
trackback

d4 logoBeing able to hide tabs until a certain value is selected in a picklist is becoming a common request. So i decided to post how you can accomplish that. Apply this code on the onload and onchane events (replace with your field names).

if
(crmForm.all.new_fieldname.DataValue == 1)
{
crmForm.all.tab1Tab.style.display = ‘none’;
crmForm.all.tab2Tab.style.display = ‘none’;
crmForm.all.tab3Tab.style.display = ‘inline’;
crmForm.all.tab4Tab.style.display = ‘inline’;
crmForm.all.tab5Tab.style.display = ‘none’;
crmForm.all.tab6Tab.style.display = ‘none’;
crmForm.all.tab7Tab.style.display = ‘none’

}

else if
(crmForm.all.new_fieldname.DataValue == 2)
{
crmForm.all.tab1Tab.style.display = ‘none’;
crmForm.all.tab2Tab.style.display = ‘none’;
crmForm.all.tab3Tab.style.display = ‘inline’;
crmForm.all.tab4Tab.style.display = ‘none’;
crmForm.all.tab5Tab.style.display = ‘inline’;
crmForm.all.tab6Tab.style.display = ‘none’;
crmForm.all.tab7Tab.style.display = ‘none’

}
else if
(crmForm.all.new_fieldname.DataValue == 3)
{
crmForm.all.tab1Tab.style.display = ‘none’;
crmForm.all.tab2Tab.style.display = ‘none’;
crmForm.all.tab3Tab.style.display = ‘inline’;
crmForm.all.tab4Tab.style.display = ‘none’;
crmForm.all.tab5Tab.style.display = ‘none’;
crmForm.all.tab6Tab.style.display = ‘inline’;
crmForm.all.tab7Tab.style.display = ‘none’

}
else if
(crmForm.all.new_fieldname.DataValue == 4)
{
crmForm.all.tab1Tab.style.display = ‘none’;
crmForm.all.tab2Tab.style.display = ‘none’;
crmForm.all.tab3Tab.style.display = ‘inline’;
crmForm.all.tab4Tab.style.display = ‘none’;
crmForm.all.tab5Tab.style.display = ‘none’;
crmForm.all.tab6Tab.style.display = ‘inline’;
crmForm.all.tab7Tab.style.display = ‘none’
}

For more information about Dynamics Four or to contact us please visit http://www.dynamics4.com

Advertisements

Comments»

No comments yet — be the first.

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: