开发者

Unable to save data set by iframe in Dynamics CRM 2011

开发者 https://www.devze.com 2023-03-18 04:18 出处:网络
I’m having an iframe with some javascript running, which will dynamically add more textboxes to the page, according to how many dates we need to add.

I’m having an iframe with some javascript running, which will dynamically add more textboxes to the page, according to how many dates we need to add.

When pushing a send button on the iframe page I’m able to set the value on my dynamics crm form using:

parent.document.forms[0].all.new_running.value = koersler;

where koersler is the data combined from the textboxes.

This works fine, but when saving the form, the data in the textbox, new_running, is not being saved.

I have tried to set the setSubmitMode(“always”) on the save event on the form, with little luck sine dsb_ru开发者_JS百科nning seem to be null, even though the data can be seen on the page.

Any hints on how to save the data???

Looking forward to get your help.


Could be an issue of the form control not matching up with the attribute data.

from the SDK:

For most script development work outside of Microsoft Dynamics CRM, developers may be accustomed to referring to page elements by using the document.getElementById method. For Microsoft Dynamics CRM form scripts this method is not supported. It is important to recognize that the attribute stores the data and the control is simply the presentation of the attribute in the form. For controls bound to attributes you may need to adjust the way you are accustomed to accessing data in the form.

I would try setting the value of the attribute with the Xrm.Page scripting library.

var control = Xrm.Page.data.entity.attributes.get("new_running");
control.setValue("koersler");
0

精彩评论

暂无评论...
验证码 换一张
取 消