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:31 AM
what type of field is the distinguished_name ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2016 01:34 AM
using poc.sys_id will copy the name of the requester because the getreference is 'caller_id'.
distinguished_name type is string. it's stored on each user profile.
Alex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2016 01:37 AM
It worked fine for me just try putting some alerts.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2016 01:49 AM
What is the field name on which you have written this change client script, it should be called_id
Also Try This: just make sure for the is loading and newvalue parameters
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading){
if(!newValue == '') {
var poc = g_form.getReference('caller_id');
g_form.setValue('dsn_name',poc.distinguished_name);
}}
//Type appropriate comment here, and begin script below
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2016 02:03 AM
The field name is caller_id
tried your solution, still not working. The value I'm getting is " undefined" as shown in the picture above.
I don't understand what I'm doing wrong. The script looks correct but it's not pulling the value