Incident state in closed should not be editable in list view

catchdini
Tera Expert

I have an UI policy to make the incident state field read only when the state is closed. However I noticed that, in the list view, Im able to change the status from Closed to whatever available I want i.e) when I click on 'Closed' in Incident application or when I query for incident state is closed, the state in the query are editable or can be changed. How do I restrict this?

1 ACCEPTED SOLUTION

Hi,



I can see the error now.


Please remove the numbers from your client script(on the left side green one like 02,03....)


Please copy the below script and paste it


View solution in original post

10 REPLIES 10

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi,



You can go with ACL on cell edit or you can have the client script on cell edit for this requirement.


Please refer the below thread for further details


In Incident list view we have a field state where I need to hide the closed state to be not populat...


Please let me know if you have any questions



Thanks,


Pradeep Sharma


Hi,


Im getting an error message when I use the given code. PFA the screenshot. Can you plz help me?



Hi,



Not sure why are you getting an error as I can still run this one with out any errors.



function onCellEdit(sysIDs, table, oldValues, newValue, callback) {      


      var saveAndClose = true;      


      if (newValue == "7") {      


              alert("You cannot change the state to Closed from the list view.");      


              saveAndClose = false;      


      }      


           


      callback(saveAndClose);      


}


Hi,



I can see the error now.


Please remove the numbers from your client script(on the left side green one like 02,03....)


Please copy the below script and paste it