- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2018 04:09 PM
I've created some variables on a catalog item that are references to things like Manager name, location and department and then added an on load client script to populate the users information when the requesters name is inputted on the form.
What I would like to do is make the requesters manager, location and department read only. The problem I am getting is that when I've created a UI Policy Action it starts of read only but when the fields are populated they don't remain read only.
Is there a way to make them read only even after they have been populated?
Thanks in advance.
Solved! Go to Solution.
- Labels:
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2018 08:34 AM
Ok. Use the below code with uses getReference Callback. Since GlideRecord is not a good practice to use in Client Script. Run this and let me know, if there are still issues.
Also confirm there is no other UI policy or client script that is marking these field editable?
function onChange(control, oldValue, newValue, isLoading) {
if(newValue){
var grUser = g_form.getReference('staff_name', popCallerInfo);
}
//Nested 'getReference' callback function for variable access
function popCallerInfo(grUser){
g_form.setValue('u_job_title' , grUser.title); //set job title
g_form.setValue('u_department' , grUser.department); //set department
g_form.setValue('u_location' , grUser.location); //set location
g_form.setValue('u_contact_number' , grUser.mobile_phone); //use mobile phone field to set contact number
g_form.setValue('u_manager_name' , grUser.manager); //set job title
}
}
Please mark this response as correct or helpful if it assisted you with your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2018 08:47 AM
When Client script runs it blocks the user interaction. So when we make a GlideRecord which is a Synchronous call can freeze the form, if you are querying through thousands of record. If you you a callback function or Glideajax, they are asynchronous. So they dont block the form. You will get good information in the below article.
https://snprotips.com/blog/2016/2/6/gliderecord-client-side-vs-server-side
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-20-2018 05:01 AM
Thanks for all your help.