variable value is "undefined"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2016 01:16 AM
Hello,
I have a variable on a record producer named "dsn_name". At the moment, the type of the variable is wide single line text.
I also have another variable named caller_id which is a reference to sys_user table and it's mapped on the caller field. By default this value is populated with the ID of the person currently logged in the instance.
I'm trying to pull a value from the'caller_id"(distinguished_name) and populate it in the "dsn_name" field. My catalog client script looks like this:
function onChange(control, oldValue, newValue, isLoading) {
var poc = g_form.getReference('caller_id');
g_form.setValue("dsn_name", poc.distinguished_name);
}
I'm getting 'undefined' instead of showing the distinguished_name value.
Any ideas would be me appreciated !
Thanks
Alex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2016 01:27 AM
is that field name correct ? And also check the distinguished_name value in the table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2016 01:29 AM
I'm sure the names and values are correct. I think it's a problem with the script. For example if instead of "distinuished_name" I use "location"(should show the requester's location) i'm still getting undefined.
Alex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2016 01:35 AM
Hi Alex,
I just tried in my instance and it is working fine with below script.
var poc = g_form.getReference('caller_id');
g_form.setValue("short_description", poc.department);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2016 01:38 AM
Yes, I'm using same code in other record producers and it's working fine. The script looks correct but somehow it's not working for this item I'm currently working on