How to Show/Hide field in
CRM 2011 Using Javascript function?
The following code can be helpful to Show/Hide field in
CRM 2011 Using Javascript function.
function
HideShowField(){
//Hide the field.
Xrm.Page.ui.controls.get(
"fieldName"
).setVisible(
false
);
//Show the field.
Xrm.Page.ui.controls.get(
"fieldName"
).setVisible(
true
);
}
How to make Disable/Not Disable field in
CRM 2011 using Javascript function?
The following code can be helpful to make Disable/Not Disable field in
CRM 2011 Using Javascript function.
function
SetDisableField(){
var
field = Xrm.Page.getControl(
"fieldName"
);
// if field is available on the form then make disable of the field.
if
(field){
field.setDisabled(
true
);
}
// if field is available on the form then remove disable property from the field.
if
(field){
field.setDisabled(
false
);
}
}
How to set Requirment Label of field in
CRM 2011 using Javascript function?
The following code can be helpful to set Requirment Label of field in
CRM 2011 Using Javascript function.
function
setRequirmentLabel(){
var
field = Xrm.Page.getAttribute(
"fieldName"
);
// If the field is available on the form then set required Label of the field.
if
(field){
field.setRequiredLevel(
"required"
);
}
//if field is available on the form then remove required Label from the field.
if
(field){
field.setRequiredLevel(
"none"
);
}
}
How to Show/Hide Tab and Section in
CRM 2011 Using Javascript?
The following code can be helpful to Show/Hide Tab and Section in
CRM 2011 Using Javascript.
function
HideShowTab(){
//Hide the Tab.
Xrm.Page.ui.tabs.get(
"tabName"
).setVisible(
false
);
//Show the Tab.
Xrm.Page.ui.tabs.get(
"tabName"
).setVisible(
true
);
}
function
HideShowSection(){
//Get name of section.
var
section = Xrm.Page.ui.tabs.get(
"tabName"
).sections.get(
"sectionName"
);
//Hide the section.
section.setVisible(
false
);
//Show the section.
section.setVisible(
true
);
}