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-19-2024 04:06 AM
Hi @Rekha20 ,
You are trying to set the Filed values with Jason which will not work for Reference field. Can you try creating 2 different functions for "Org Number" and "Sub Account" and try passing sys id through array
for example inside Org Number function
getOrgAndSubAccountValues: function(siuValue) {
var orgAndSubAccountValues =["c374861c1b4ba5108e9987f5624bcbb9", "0b74861c1b4ba5108e9987f5624bcbc1"];
if (siuValue === "D") {
return "sys_idIN" + orgAndSubAccountValues.toString();
}
},
Advanced reference qualifier for Org Number variable:
Javascript: new setSubAccount.getOrgAndSubAccountValues(current.siu_fund)
Similarly try creating a new function for sub account and in reference qualifier call that function.
Note: Try to follow the best practice so to store the sys id in system property and then call in your script include
Please check and Mark Helpful and Correct if it really helps you.
Regards,
Swathi Sarang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2024 10:56 PM
I tried :
Script Include:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2024 02:48 AM - edited 02-20-2024 02:48 AM
Hi @Rekha20 ,
I have noted few points, try doing below steps,
1.remove join() add toString()
2.Try adding gs.info in every step to check whether the value is coming or not
3.remove === keep ==
4.check backend value of "D"
5.check the backend name of all the fields
and please screenshots of the error you are getting
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-20-2024 04:22 AM - edited 02-20-2024 04:22 AM
Here is the updated SI: