Google Anlatics

Thursday, June 27, 2013

CRM 2011 with JavaScripts

How to show/hide filed
Xrm.Page.ui.controls.get("city").setVisible(true/false);
How to clear filed
Xrm.Page.getAttribute("city").setValue(null);
How to enable/disable
Xrm.Page.ui.controls.get("city").setDisabled(true/false);
Modify Field Label Tooltip 
document.getElementById("field_name_c").setAttribute("title","tooltip text");
Modify Lookup Button Tooltip 
document.getElementById("field_name").setAttribute("title","tooltip text”);
Set required Filed
function SetRequirementLevelNon(fieldName) { var type = Xrm.Page.data.entity.attributes.get(fieldName); type.setRequiredLevel("none"); } function SetRequirementLevel(fieldName) { var type = Xrm.Page.data.entity.attributes.get(fieldName); type.setRequiredLevel("required"); }

No comments:

Sri Lanka .NET 
                Forum Member