Hi i want know, if we set value from javascript are they just for field that appear on form ? or we can set value that not appear on form too ? im using this method to run set value on javascript
*This post is locked for comments
Hi i want know, if we set value from javascript are they just for field that appear on form ? or we can set value that not appear on form too ? im using this method to run set value on javascript
*This post is locked for comments
thanks for your answer, it works with api. so i create api request to update the value, without change the form
Hi ,
Field should be exists in the form to set the value using javascript.
Below line having some issue with the value , if the value is text then it will be inside "" like below .
Xrm.Page.getAttribute("fieldname").setValue(edc());
here is the correct code -
Xrm.Page.getAttribute("fieldname").setValue("test");
Hi,
The field needs to be on a form. You can hide it though. This is because JavaScript read the elements which renders in the browser, so if the field is on the form, it will render and will be accessible using JS. Even if the field is hidden, it will render has hidden but still accessible.
The error could be because you do not have the field on the form? You could also got the error teh way you are setting the value i.e. a methor edc() inside setvalue ( I haven't tested this though).
We can update the field which are not form using web api but adding the field and hiding it is much more easier.
Hope this helps.
Hi,
You can not set value of a field that is not on form.
If you really want that then you have to use web API and update entity. But it reduce performance.
Hence I suggest to put that particular field on form and make it invisible.
André Arnaud de Cal...
292,516
Super User 2025 Season 1
Martin Dráb
231,399
Most Valuable Professional
nmaenpaa
101,156