Tuesday, December 27, 2011

How to get Optionset values in MS CRM 2011 using javascript

below are the ways to get the Optionset details
get the object "<optioset_name>")
Xrm.Page.data.entity.attributes.get("aic_prmsalutation")

get the value
Xrm.Page.data.entity.attributes.get("aic_prmsalutation").getSelectedOption().value //also this will retrun the same int value

get the string value
Xrm.Page.data.entity.attributes.get("aic_prmsalutation").getSelectedOption().text//this will return the display string value not the int value

Xrm.Page.data.entity.attributes.get("aic_prmsalutation").getValue() // this will give the interger value as 96770000 like this

No comments:

Post a Comment