- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2016 09:26 AM
Hi,
I need some help with a catalog client script. I have a u_requested_for field that references the sys_user table. If the user that's entered in that field has a job title of "Physician", I would like an alert to show. The job title field name (u_title) on the sys_user table is referencing the u_job_codes table.
Here's the info on the job title field:
Below is my catalog client script that's not working.
I think the issue is on line 6. I've tried var job = requester.u_job as well, and that doesn't work either. Please help.
Thanks,
Maria
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2016 02:22 PM
Thanks balsu333. This worked for me.
Here's my updated script:
function onChange(control, oldValue, newValue, isLoading){
var user = g_form.getReference('u_requested_for', doAlert);
}
function doAlert(user){
if(user.u_job == '8d7168dc0f63a900f94f46ace1050ebe'){
alert('Hospital Staff Physicians requesting Epic or Webmail remote access must contact the Physician Support Line at (866) 405-3742.');
var URL = "navpage.do";
top.window.location = URL;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2016 09:31 AM
I may be incorrect, but I believe a limitation of getReference is that it only returns OOB fields.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2016 10:05 AM
Hi Maria,
You are trying to do double dot-walking and that to in the client script, in this case, its better preferred to do a Glide Ajax call from client script
and return True or false.
Glide Ajax is better way as you will be isolating all the code to check the title of the user away from client script and in server side -
Hopefully it helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2016 10:09 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2016 02:22 PM
Thanks balsu333. This worked for me.
Here's my updated script:
function onChange(control, oldValue, newValue, isLoading){
var user = g_form.getReference('u_requested_for', doAlert);
}
function doAlert(user){
if(user.u_job == '8d7168dc0f63a900f94f46ace1050ebe'){
alert('Hospital Staff Physicians requesting Epic or Webmail remote access must contact the Physician Support Line at (866) 405-3742.');
var URL = "navpage.do";
top.window.location = URL;
}
}