Make a field readonly in a business rule

lindac
Kilo Explorer

Is there a way to make a field readonly based on roles in a business rule. I cannot locate anyting on this site or the SN wiki site.

Thank you,

Linda

8 REPLIES 8

CapaJC
ServiceNow Employee
ServiceNow Employee

Linda, I had a quick look at your Incident from October. I think the issue there is that the page where the script wasn't firing is not an Incident form, but rather a catalog item that creates an Incident. So Incident client scripts don't apply.

Then, when the Incident is subsequently opened, the client script works because you're actually on the Incident form.

Perhaps you could use a Catalog Client Script for the catalog item? You could have it do the same thing as the one for the Incident table, but it would work on that specific catalog item:

http://wiki.servicenow.com/index.php?title=Creating_a_Catalog_Client_Script


lindac
Kilo Explorer

That made so much sense and make the changes you suggested, but it still did not work. It is totally ignored. Just to be clear, the user does not have the opportunity to set or change the severity from the Report an Incident form (catalog item). After the incident is created, when the user accesses the self-service view they have access to the field.


CapaJC
ServiceNow Employee
ServiceNow Employee

You have a client script named "Maximo - Load" that is generating a JavaScript error on the ESS view of the Incident form. It is trying to do the following:



$('incident.u_computer_name').insert(blah blah blah)


But the u_computer_name field isn't on that view of the form, so it's blowing up. Try the following instead:



var e = $('incident.u_computer_name');
if (e)
e.insert(blah blah blah)


That will check whether $('incident.u_computer_name') exists before trying to do something with it.

Caveat: there may well be other things wrong with that and other scripts on the ESS view, that was just the first one I blew up on when I had a look.


lindac
Kilo Explorer

Looks like you solved the issue. Instead of modifying the client script, we decided to add the field to the self-service form and the client scripts are working again.

I plan to reach out to the developer of the Maximo - Load client script to inform him of the issue we had.

Thank you so much for your assistance.

Linda