Unable to fetch the reference field value in catalog client script

janindiadoc_1
Tera Expert

I have a record producer with three reference variables say A,B and C. B and C fields are populated based on value of A.  I'm using the new "Auto Populate" feature where I have put the dependent question as A for B and C.

Created a client script "on change" of variable A.

var a = g_form.getValue("a");
var b = g_form.getValue("b");
var c = g_form.getValue("c");

Alert shows the value for "A" selected, but not B and C (coming as empty) for the first time.
Second time when I change the reference field value for "A" the first selections sys id is coming for B and C.

I want to have the values for B and C as soon as I change A. I'm not sure how to fix this issue. Please help if anyone has faced this issue before and have a solution.

Thanks

6 REPLIES 6

Amit Verma
Kilo Patron
Kilo Patron

Hi @janindiadoc_1 

 

We don't need an On-Change Catalog Client Script to make it work. This could be simply done by configuring Auto Populate feature correctly. Please refer below snips and check the config on your end. I have created three variables namely User Name, First Name and Last Name, all three referring to sys_user table.

 

AmitVerma_0-1705555471058.png

 

For Variable First Name and Last Name, I have configured auto populate as below :

AmitVerma_1-1705555528494.png

 

AmitVerma_2-1705555572203.png

 

And I get the following output which works perfectly on Change of User Name field :

 

AmitVerma_3-1705555628807.png

 

 

Thanks & Regards

Amit Verma


Please mark this response as correct and helpful if it assisted you with your question.

Thanks for the reply. It was not the issue. I'm able to populate the data based on the reference fields. It was something in the on change scripts that is not getting the value. 

But anyway the issue got resolved. Thanks 

Heya I am facing the same problem can you tell me how this got resolved.

Share the script that your trying...


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect