Help with Client Script to update the Work_Notes on the Incident Form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-20-2012 12:40 PM
Can the below script be changed to update the work_notes with the "u_reassign_reason" which is a drop down list? We get the popup box to select a reason that the Help Desk is assigning the incident to another group, we'd like for the value from the reason be updated to the work_notes on the incident.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading) {
return;
}
if(g_form.isNewRecord()){
if (g_form.getValue('assignment_group') != '8051349c0a0a3c1f005d2bbd78082b2d') {
g_form.setDisplay('u_reassign_reason',true);
g_form.setMandatory('u_reassign_reason',true);
alert("Reassign reason is mandatory");
}
else {
g_form.setDisplay('u_reassign_reason',false);
g_form.setMandatory('u_reassign_reason', false);
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-20-2012 01:57 PM
You could add a client script that runs on change of
that adds it to the work notes like:
u_reassign_reason
g_form.setValue("work_notes", g_form.getValue("u_reassign_reason"));
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2012 06:20 AM
Thank you Shane, one more question. Is there any way to put verbiage in front of the u_reassign_reason? Like "Incident Reassigned due to" + u_reassign_reason.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2012 07:03 AM
You could do
g_form.setValue("work_notes", "Incident reassigned due to " + g_form.getValue("u_reassign_reason"));
or
var workNotesVal = "Incident reassigned due to " + g_form.getValue("u_reassign_reason");
g_form.setValue("work_Notes",workNotesVal);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2012 08:49 AM
Great, works perfect!! Thank you both very much.