- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2015 12:15 PM
I have created a client script to copy fields from "Problem Ticket" to "Problem Task Ticket", it didn't work. Can someone guide me through?
Table=Problem
Type=onLoad
function onLoad() {
//Type appropriate comment here, and begin script below
if(g_form.isNewRecord() && g_form.getValue('parent') != ''){
var prb = g_form.getReference('parent', setFields);
}
function setFields(prb){
g_form.setValue('assignment_group',prb.assignment_group);
g_form.setValue('priority',prb.priority);
}
}
Thanks.
Steven
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2015 10:52 AM
And then do javascript:parent.priority for an override on the priority.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2015 06:45 AM
Mike: I'm new in ServiceNow and thanks so much for your guidance... This is exactly what our requirement is. Click the "New" button, copy the "Assignment Group" and "Priority" from "Problem" to "Problem Task", allow user to re-select if you want.
I created the BR, but it didn't work. Any hints:
I
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2015 07:01 AM
this is an on display BR... so unless i am mistaken it is going to run everytime they display the record.. this means that the assignment group and priority will be reset everytime it is opened.
i believe what you want is an on insert with the same br
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2015 07:07 AM
I'd tried to use "when=Before", "Insert" is clicked, but the two fields weren't populated...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2015 07:09 AM
i am not clear what you mean by the two fields weren't populated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2015 07:42 AM
The "Assignment Group" and "Priority" fields in Problem Task Ticket were empty. We want these two fields data can be populated to Problem Task Ticket when click New button.