Dynamics 365 Updating Readonly Field – setSubmitMode()

To update readonly fields with Javascript simply use setSubmitMode() after setValue() function.

  • always: The data is always sent with a save.
  • never: The data is never sent with a save. When this value is used, the column(s) in the form for this column cannot be edited.
  • dirty: Default behavior. The data is sent with the save when it has changed.
UpdateReadonlyField: function (context) {
var formContext = executionContext.getFormContext();
formContext.getAttribute("myreadonlyfield").setValue(newValue);
formContext.getAttribute("myreadonlyfield").setSubmitMode("always");
}

One response to “Dynamics 365 Updating Readonly Field – setSubmitMode()”

  1. […] the form for this column cannot be edited. dirty: Default behavior. The data is sent with the … Continue reading Dynamics 365 Updating Readonly Field -setSubmitMode() Read Complete Post and Comments $(document).ready(function(){ if(''!='') { $(".post […]

Leave a comment