简体   繁体   中英

how to save data through javascript in select list in crm

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)

it is throwing me and error

当尝试使用XrmServiceToolkit分配选项集值时, new_category看起来确实像这样,您需要像这样分配值:

entity.attributes["new_category"] = { value: categoryValue, type: "OptionSetValue" };

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM