JavaScript Reference for Microsoft Dynamics CRM
1) Get the Text value of a Lookup field
function AlertTextFieldValue(){
var MainValue = Xrm.Page.data.Entity.attributes.get("new_name").getValue();//new_name nothing but Schema name for a field name
Alert('MainValue');
}
2)Get the text Value for Option Set
function AlertOptionsetvalue(){
var mainvalue = Xrm.Page.data.Entity.attributes.get("new_name").getText();//new_name nothing but Schema name for a field name
alert(mainValue);
}
3) Set the value of a string field:
function SetStringFieldValue(){
var stringField = Xrm.Page.Data.Entity.attributes.get("new_name");//new_name nothing but Schema name for a field name
alert(stringField);
}
4) Disable fields:
function Disablefields(){
var AddressType = Xrm.Page.ui.controls.get("address1_addresstypecode");
AddressType.setDisabled(true);
}
5)Show/Hide Navitem:
function showhideNavitem(){
var objNavItem = Xrm.Page.ui.navigation.items.get("navContacts")
objNavItem.setVisible(false);
}
1) Get the Text value of a Lookup field
function AlertTextFieldValue(){
var MainValue = Xrm.Page.data.Entity.attributes.get("new_name").getValue();//new_name nothing but Schema name for a field name
Alert('MainValue');
}
2)Get the text Value for Option Set
function AlertOptionsetvalue(){
var mainvalue = Xrm.Page.data.Entity.attributes.get("new_name").getText();//new_name nothing but Schema name for a field name
alert(mainValue);
}
3) Set the value of a string field:
function SetStringFieldValue(){
var stringField = Xrm.Page.Data.Entity.attributes.get("new_name");//new_name nothing but Schema name for a field name
alert(stringField);
}
4) Disable fields:
function Disablefields(){
var AddressType = Xrm.Page.ui.controls.get("address1_addresstypecode");
AddressType.setDisabled(true);
}
5)Show/Hide Navitem:
function showhideNavitem(){
var objNavItem = Xrm.Page.ui.navigation.items.get("navContacts")
objNavItem.setVisible(false);
}
No comments:
Post a Comment