admin管理员组文章数量:1392003
I have an OptionSet whose default value is "Unassigned", which shows as blank to a user browsing the form.
On certain conditions, I have to clear the option set and set its value back to "Unassigned".
Here's the code that I have:
Xrm.Page.Data.Entity.Attributes.Get("fieldName").setValue(null);
That indeed does change the value to "Unassigned" and shows the option set with a blank, but it doesn't seem like this is what gets mitted to the database.
If I run an Advanced Find, I still see the old value that was there prior to running the code above on it.
Anything I'm missing ?
Thanks.
I have an OptionSet whose default value is "Unassigned", which shows as blank to a user browsing the form.
On certain conditions, I have to clear the option set and set its value back to "Unassigned".
Here's the code that I have:
Xrm.Page.Data.Entity.Attributes.Get("fieldName").setValue(null);
That indeed does change the value to "Unassigned" and shows the option set with a blank, but it doesn't seem like this is what gets mitted to the database.
If I run an Advanced Find, I still see the old value that was there prior to running the code above on it.
Anything I'm missing ?
Thanks.
Share Improve this question asked Nov 20, 2013 at 22:07 Francis DucharmeFrancis Ducharme 4,9978 gold badges46 silver badges88 bronze badges 02 Answers
Reset to default 5Try,
Xrm.Page.getAttribute([fieldname]).setSubmitMode("always");
Sometimes when values are changed by script (especially when they are read only) CRM doesn't pick up the change.
Instead of google I would remend starting with this link (which I can't take credit for!):
http://danielcai.blogspot./2011/04/microsoft-dynamics-crm-2011-javascript.html
There is a link to a skydrive document which has a prehensive cheat sheet for all the Xrm Namespace functions. Worth its weight in gold!
本文标签: dynamics crm 2011Setting null value through JavaScriptStack Overflow
版权声明:本文标题:dynamics crm 2011 - Setting null value through JavaScript - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744719514a2621610.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论