Saving Data When A CRM Field is Read-Only With JavaScript (setSubmitMode)

Saving data when a CRM field ist read-only is a often requriered use case, when data is fetched by javascript and written in such a field.

Many Developers don’t know in the first place, that if a CRM field is read-only on the client-side you have to set the submit mode of the attribute. Otherwise changes which are made through JavaScript code on the field (e.g. setValue) aren’t stored in the database.

The SubmitMode knows three different values (never, dirty and always), but to make sure that every change is correctly saved you should use the “always” keyword – like on the example shown below.

Learn more about the SubMode on the related MSDN article.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.