Reference field on Catalog Client Script

Maria DeLaCruz
Tera Guru

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:

find_real_file.png

Below is my catalog client script that's not working.  

find_real_file.png

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

1 ACCEPTED SOLUTION

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;


  }


}


View solution in original post

7 REPLIES 7

Good to hear its working


balsu333
Mega Expert

Even I prefer doing GlideAjax suggested by ghsrikanth


Mihir Mohanta
Kilo Sage

Hi Maria,



I the script you have written,Change the line 7 as


if(job =='sys_id of the job from u_job_codes table')



Thanks,


Mihir