14 views

 

Symptoms


Fields set as read-only on the Standard Change properties are not being set as read-only when the change request form is loaded.

Release


Kingston Patch 5

Cause


The read-only fields for standard changes are set through a client script, "Mark standard change fields readonly". This client script gets the type of change from the form type field. If this field is not part of the change request form, due to some customization on the OOB layouts or due to using a custom layout, the client script is unable to identify the change as being standard and will not apply the standard change definitions:

var chgType = g_form.getValue("type"); 
var ga;
if (chgType == "standard") {
     if (g_form.isNewRecord()){
          ga = new GlideAjax('StdChangeUtils');
          ga.addParam('sysparm_name', 'ajaxFunction_getReadOnlyFieldsOnInsert');
          ga.getXMLAnswer(markReadonly);
     } else {
          ga = new GlideAjax('StdChangeUtils');
          ga.addParam('sysparm_name', 'ajaxFunction_getReadOnlyFields');
          ga.addParam('sysparm_sysId', g_form.getUniqueValue());
          ga.addParam('sysparm_tableName', 'change_request');
          ga.getXMLAnswer(markReadonly);
     }
}

 

Resolution


Adding the type field to the form will solve this issue:

  • Open any change request;
  • Click on "Additional Actions' menu on the top left or right click on the header bar;
  • Choose Configure -> Form Layout;
  • Add the "type" field to the Selected list and click Save;

 

You can also customize the client script "Mark standard change fields readonly" and use an alternative way to get the type of change for the record.

Article Information

Last Updated:2018-08-13 17:04:14
Published:2018-08-10