Auto populate description of Complaint task from Complaint Case
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2024 08:59 AM
Hi all,
The requirement is auto populate certain field values from linked Complaint Case into the Complaint task's description field.
Also, want the field attribute to be in bold
For example,
Account: ServiceNow
Contact: Fred Luddy
I have tried an after-insert Business rule but seems like it's not working (script attached below).
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var cmp = new GlideRecord('sn_complaint_case');
if (cmp.get(current.parent)) {
var message = '<b>' + 'Account: ' + cmp.getDisplayValue('company') + '/n' + '<b>' + 'Contact' + cmp.getDisplayValue('contact');
current.description = message;
}
})(current, previous);
Any leads would help me a lot.
Thanks,
Sreesh Surendran
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2024 09:09 AM
When running a Business Rule after insert AND updating the current record, you need to use current.update() for the update to be saved. In this case, to avoid an unnecessary update, try running the Business Rule before Insert.