Monday 10 December 2012

Set the value of Option set field from one entity to another entity in CRM 2011 using javascript

var createContact = new XrmServiceToolkit.Soap.BusinessEntity("contact");// Target entity name

var country=Xrm.Page.data.entity.attributes.get("tvsi_countryregion").getValue();//Optionset value
if(country != null)
{
    createContact.attributes["tvsi_countryregion0"]={ value: country, type: "OptionSetValue" };
}

No comments:

Post a Comment