Thursday, May 3, 2007

Hiding and Disabling CRM fields with Javascript

I always forget the syntax for hiding and disabling fields in CRM. Below are some common examples:

//hide contract and contract line fields = 'hidden'; = 'hidden';

//hide a tab
crmForm.all.tab3Tab.visibility = "hidden";

//disable lookup fields
var oField = crmForm.all.SOME_FIELD_ID;
oField.Disabled = !oField.Disabled;

//disable radio button field
crmForm.all.new_inboundoutbound.disabled = true;

//disable datetime field
//disable data field
var oField = crmForm.all.new_resolutiondate;
oField.Disabled = !oField.Disabled;

No comments: