Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

SCTask Requested for unable to "read only"

Max Lin
Tera Contributor

find_real_file.png

 

Hi there! I can't seems to make "Requested for" as read only. i have tried find the fields in UI policy but not available, then i have tried to add script and it didnt work too. Please help me 🙂

Thank you!

find_real_file.png

find_real_file.png

6 REPLIES 6

AnirudhKumar
Mega Sage

The Requested For field comes from the Request(sc_request).

The field you are seeing is dot walked to the sc_task.

Try this in your client script:

g_form.setReadonly('request.requested_for');

AnirudhKumar
Mega Sage

Right-click on the Requested For field and click Show - 'requested_for'

The top-most line should give you a hint where the field comes from

Maik Skoddow
Tera Patron

Hi @Max Lin 

you were on the right path with your UI Policy, but in your case it is a bit tricky as the field "Requested for" is a dot-walk field over several levels (right click on the label and then "Show - 'requested_for'):

 

find_real_file.png

 

This path has to be selected at field selector:

find_real_file.png

And this will lead to a read-only field

find_real_file.png

Kind regards
Maik

Max Lin
Tera Contributor

Hi, thanks for all the prompt help, i have tried it didn't work either. However, let me give a better view. The requested_for is inside Variables of the catalog item. 

There's also a weird behavior that when the state is Not 'Closed Complete' it was read-only. But when state is 'Closed Complete' it become editable. 

Sadly i can't right click to do a UI Debug on this catalog item variables.

Any ideas pelase?

 

 

 

find_real_file.png

 

find_real_file.png

find_real_file.png