Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

populating reference field list when another field changes

samadam
Kilo Sage

I am trying to populate a reference field values when another field changes. I have script include and calling it from catalog client script but doesnt seem to be working. When I print it is getting the right values but not setting the reference list. 

I am using the following, 

g_form.setValue('office', answer1);
 
or should I set the values differently?
 
Thank you
6 REPLIES 6

Hi @samadam ,

 

The code which i had given you in above post is tested in my PDI and working well.

Share you full code then i may help you if you are missing something.

 

 

var ga1 = new GlideAjax('office_select');
        ga1.addParam('sysparm_name', 'getOffice');
        ga1.getXML(CallBack1);
        function CallBack1(response) {
            var answer1 = response.responseXML.documentElement.getAttribute("answer");
            alert(answer1);
           g_form.setValue('office', answer1);
        }