Why 2 journal entry records are created when work_notes are updated using before business rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2019 02:10 AM
Hi All,
For each note, I would like to add a hash tag. For achieving this, I have have created a before business rule on the task form and appending the work_notes with tag name
BEFORE business rule (Order 100)
(function executeRule(current, previous /*null when async*/) {
// Add your code here
current.work_notes = current.work_notes+"\n#1234Viswa";
})(current, previous);
But when I enter a work note, I see two entries. One with the entered value, the other with the hastag. Is it possible to have only journal record entry ?
Regards
Viswa
- Labels:
-
Live Feed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2019 04:10 AM
Hi Harsha,
setJournalEntry, didn't work in any scoped applications. Hence moved the code to Global scope, but I am still having the same issue.
Now with the above code, I have two journal entries, one with original value and the other only with "#1234Viswa"
Regards
Viswa

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2019 04:28 AM
Can you try like this
(function executeRule(current, previous /*null when async*/) {
// Add your code here
current.work_notes = current.work_notes+"\n#1234Viswa";
current.update();
})(current, previous);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2019 05:18 AM
if the above solution is not working , can you give a try with onSubmit client script
Sample code:
function onSubmit() {
//Type appropriate comment here, and begin script below
g_form.setValue('work_notes',g_form.getValue('work_notes') + "\n#1234Viswa");
}