Setting One Field Based on Another
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-09-2009 09:03 AM
Good day,
I'm trying to set 2 separate fields based on the setting of a third. More specifically, I have created a reference field (called 'Problem Item') on the ESS View of the Incident form which references the cmdb_ci table - the intent being to allow the customer to simply type the item he / she is having a problem with and have the field populate. On the ITIL worker side, I need to set 2 other fields called Category & subcategory on what is selected in the Problem Item field on the ESS Incident form.
What would be the best method to accomplish this?
I'm new to Service-now and have tried UI policies, client scripts, and business rules but have not been able to make it work - but I suspect this is most likely because of my unfamiliarity with how these work and my weak Javascript skills.
Any suggestions would be greatly appreciated. Thanks.
- Labels:
-
Incident Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-15-2009 05:40 AM
Have you tried a Client side on change script something like
function onChange(control, oldValue, newValue, loading) {
if (loading)
return;
g_form.setValue('category', g_form.getValue('ci_Selected.category'));
}
Then set a category for each CI. You have to make sure that the chouse list values match or it has issues.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-15-2009 07:38 AM
I've had some trouble getting the client scripts to work - mainly because I'm still learning the proper syntax, but I'll give this a try. Thanks for replying.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-16-2009 04:50 AM
You may want to look this wiki item over
http://wiki.service-now.com/index.php?title=Client_Scripts
Specificly the "Look up the value of a reference field " section.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-17-2009 11:10 AM
By the way this works great
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading)
return;
var caller = g_form.getReference('caller_id');
g_form.setValue('u_phone', caller.phone);
}