Change Request Values on Standard Change Proposal form should be read only

DhanishaSuresh
Tera Contributor

Hello ServiceNow community,

When attempting to propose a standard change template from a normal change request, the system redirects us to a form where several fields are pre-populated based on the details of the normal change request. Currently, all these fields are editable.

Our team has a specific requirement: we need to restrict the Change Request Values to read-only mode, preventing any user from making edits.

I’ve attached a screenshot of the form for reference. Any assistance would be greatly appreciated.

Thank you! 🙌



2 REPLIES 2

Community Alums
Not applicable

Hi @DhanishaSuresh ,

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);
     }
}

 

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.

@Community Alums 
Thanks for your response,

I intend to set the Change Request Values Variable as ‘Read Only.’ This form becomes available when we click on the ‘Propose a new Standard Change Template’ UI Action.

DhanishaSuresh_0-1711560005183.png