Catalog Client Script for auto populate Department not working for Lookup Select box field type
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-13-2014 02:03 AM
I have implemented a small Catalog Client Script to auto populate Department based on the caller in a Service Catalog item.
But I had initially issues get it to work and I found out that the cause was because the department field was a Lookup Select box. When I changed it to a reference field, it did work. I rather would like to have it a Lookup Select box, does anyone know how to get this to work?
Here is the script:
function onLoad(control, oldValue, newValue, isLoading) {
if (isLoading)
return;
if (newValue == '') {
g_form.setValue('department', '');
return;
}
if (!g_form.getControl('department'))
return;
var caller = g_form.getReference('caller_id', setdepartment);
}
function setdepartment(caller) {
if (caller)
g_form.setValue('department', caller.department);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-13-2014 11:23 PM
Thank you, I will try this out later this week
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-15-2014 05:39 AM
Hello,
has anyone actually came out with a solution to this question?
I have a reference field in a variable set that needs to be autopopulated with the sc_cart requested_for Manager
and I've tried the above solutions and does not seem to work.