Need to populate one variable value based on another
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2024 09:42 AM
Hi All,
I have form:
where I need to populate "Org Number" and "Sub Account" based on SIU Fund variable.
"Org Number" and "Sub Account" referring to same table but having simple referring qualifier:
"Org Number" where Type = Organization
"Sub Account" where Type = Account
So requirement is:
- SIU Fund variable value is "A", Org Number" should populate as 30553, sub account should populate as 5897
- SIU Fund variable value is "B", Org Number should populate as 30564, sub account should populate as 5897
- SIU Fund variable value is "C", Org Number should populate as 30122, sub account should populate as 5897
- SIU Fund variable value is "D",
- There should only be two value available to select for Org Number variable as below
- 03790, sub account 5897
- 03828, sub account 5897
Challenge I am facing is how to make it dynamic for
- SIU Fund variable value is "D",?
Any help would be appreciated.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2024 11:45 AM
Hi @Rekha20 ,
You can try the autopopulate feature of catalog item where based upon selection of one field value other fields can be populated without any scripting.
Take a look at below link
Thanks,
Danish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2024 12:04 PM - edited 02-17-2024 12:04 PM
Hi @Rekha20 ,
Please find the comments for below queries,
- SIU Fund variable value is "A", Org Number" should populate as 30553, sub account should populate as 5897
- SIU Fund variable value is "B", Org Number should populate as 30564, sub account should populate as 5897
- SIU Fund variable value is "C", Org Number should populate as 30122, sub account should populate as 5897
For the above three you can create a onChange client script and set the value through g_form.setValue and for the below one
- SIU Fund variable value is "D",
- There should only be two value available to select for Org Number variable as below
- 03790, sub account 5897
- 03828, sub account 5897
For this you have to use reference qualifier in both of your fields("Org Number" and "Sub Account") and write a script include pass the SIU variable value to it and inside script include check for the condition whether the option selected is "D" and return the value . You can write something as below in the reference qualifier ,
Please mark this comment as Correct Answer/Helpful if it helped you.
Regards,
Swathi Sarang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2024 09:56 PM
Thank you for your response.
Please find the comments for below queries,
- SIU Fund variable value is "A", Org Number" should populate as 30553, sub account should populate as 5897
- SIU Fund variable value is "B", Org Number should populate as 30564, sub account should populate as 5897
- SIU Fund variable value is "C", Org Number should populate as 30122, sub account should populate as 5897
For the above three you can create a onChange client script and set the value through g_form.setValue and for the below one -> Yes, I did already same for this.
Regarding
- SIU Fund variable value is "D",
- There should only be two value available to select for Org Number variable as below
- 03790, sub account 5897
- 03828, sub account 5897
For this you have to use reference qualifier in both of your fields("Org Number" and "Sub Account") and write a script include pass the SIU variable value to it and inside script include check for the condition whether the option selected is "D" and return the value. You can write something as below in the reference qualifier,
My concern is- If I use reference qualifier for both variables, then client script will work?
Also, can you please help me with the script include code? Would appreciate it.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2024 02:50 AM
I have written the script include: