- 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 07:50 AM
interesting do you have it setting the values via script or from the action fields?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2015 07:54 AM
From the BR Action tab....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2015 08:27 AM
I would do a display BR with a condition that says assignment_group is empty and priority is empty, then actions that say assignment_group is same as problem.assignment_group and priority is same as problem.priority.
That will keep it from overwriting existing values.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2015 08:37 AM
try using the script from above instead of the action items...
current.assignment_group = current.parent.assignment_group;
current.priority = current.parent.assignment_group;
if this is an after business rule you will need to add
current.update();
see if that fixes it...
Mike Allen in answer to why not just create a br to update those fields you can do that... but it has to process the br every time a record is displayed.. by creating an on insert br it is ONY processed on an insert action.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2015 09:42 AM
But, no matter how you create that BR, it is not going to populate the fields until after the form is submitted. He wants to populate the fields when the form is loaded. So, the only way to do that is a display BR or an onLoad Client Script, both of which will get run every time the form is loaded. I am always a fan of putting the load on the server as opposed to the client, so I suggested the BR.