最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

dynamics crm 2011 - Setting null value through JavaScript - Stack Overflow

programmeradmin1浏览0评论

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 0
Add a ment  | 

2 Answers 2

Reset to default 5

Try,

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!

发布评论

评论列表(0)

  1. 暂无评论