- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2021 02:54 PM
Hi,
What is use of getReference().
Can anyone please give me one example for this.
Regards,
Nivedita
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2021 03:23 PM
Hi Nivedita,
You can see an example here on the Docs site.
You use it in a client script to retrieve the entire record of a reference field/variable, then you can use another column on the same record in the script to setValue of another field/variable, etc.
Here's an example which sets the value of a location variable to the location that is on the user record of the requested for.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var userref = g_form.getReference('requested_for', userLookup);
function userLookup(userref){
g_form.setValue('location', userref.location.toString());
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
What is the difference between synchronously and asynchronously, in the above context
