Unable to fetch the reference field value in catalog client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2024 07:45 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2024 09:28 PM
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.
For Variable First Name and Last Name, I have configured auto populate as below :
And I get the following output which works perfectly on Change of User Name field :
Thanks & Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2024 02:41 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2024 11:19 PM
Heya I am facing the same problem can you tell me how this got resolved.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2024 11:26 PM
Share the script that your trying...
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....