I am adding a selectlist in my web resource and then saving the data through JavaScript like this
entity.attributes['new_category'] = categoryValue;
where
categoryValue = $("#category option:selected")[0].innerHTML
But when i am creating the entity like
XrmServiceToolkit.Soap.Create(entity)
When trying to assign option set values using XrmServiceToolkit
, which new_category
does look like it is, you need to assign the value like so:
entity.attributes["new_category"] = { value: categoryValue, type: "OptionSetValue" };