String type
//Get value from string field
Xrm.Page.data.entity.attributes.get("name").getValue();
Lookup type
//Guid of lookup record
Xrm.Page.data.entity.attributes.get("AccountId").getValue()[0].id;
//Name of Lookup record
Xrm.Page.data.entity.attributes.get("AccountId").getValue()[0].name;
Option Set Type
//get value from option set
Xrm.Page.data.entity.attributes.get("industrycode").getValue();
//Get text from option set
Xrm.Page.data.entity.attributes.get("industrycode").getText();
No comments:
Post a Comment