
Hi
On a form in dynamics crm (I set the field as readonly) , I set a field on load event of form as below :
Xrm.Page.getAttribute('description').setValue("2");
But when I go to view of the record, the field I set is still empty. So I tried the following code:
Xrm.Page.getAttribute('description').setValue("2");
Xrm.Page.getAttribute('description').setSubmitMode("dirty")
var save = true;
Xrm.Page.data.refresh(save);
But still it does not save the data.
*This post is locked for comments
I have the same question (0)Hi Babak,
As told by Guido, if you want to save a read-only field, you need to set the SubmitMode to be always which ensures the value is sent to the database.
Please try the following code.
Xrm.Page.getAttribute('description').setSubmitMode("always");