- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2020 07:30 AM
I am trying to setup a business rule that will add a work note that is based on a drop-down list. (this is working) The problem i'm having is the text I need to past into the work note is formatted with Ordered List items and paragraph type markings.
I tried to get the script variable to hold the html code to format the text but it's just putting the text in
Wondering if it's possible to get the text formatted like this
Work_note field example:
This is what needs to be completed on the change
1. Step 1
2. Step 2
After this the following needs to be done
1. Step 1
2. Step 2
Here is my code for the script
if (current.operation() == 'update') {
var s = '<div class="content">' +
'<p>This Change has gone thru CAB review and has been Approved.</p>' +
'<br />' +
'<p>Once the Change has been implemented; please Update this Change Request with the following:</p>' +
'<ol><li>Result of the Change - Successful or Not Successful</li><li>Description of work that was performed</li><li>Include any additional details</li><li>Optional for ExCAB - Description of the work that was performed</li></ol><br />' +
'<p>The Implementor of the Change can either: </p>' +
'<ol><li>Update the Change Request as a Work Note after implementation</li> <br><li>Join the next scheduled CAB meeting after implementation to discuss the outcome of the Change and update the Change Request as a Work Note during the CAB meeting</li></ol>' +
'<br><p>Close Complete the Change</p>' +
'</div>';
current.work_notes = s;
current.update();
}
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2020 07:42 AM
Hi Steve, you almost got it! You can inject the HTML in the work notes using a pair of [code][/code] tags, like so:
[code]<p>This Change has gone thru CAB review and has been Approved.</p><br><p>This should be another paragraph</p>[/code]
This is the effect:
For more details, please refer to this blog article.
As for updating the record, make sure you don't use current.update(). All you need to do is set the BR as type "Update", and assign the value of the field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2020 07:42 AM
Hi Steve, you almost got it! You can inject the HTML in the work notes using a pair of [code][/code] tags, like so:
[code]<p>This Change has gone thru CAB review and has been Approved.</p><br><p>This should be another paragraph</p>[/code]
This is the effect:
For more details, please refer to this blog article.
As for updating the record, make sure you don't use current.update(). All you need to do is set the BR as type "Update", and assign the value of the field.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2020 07:45 AM
I agree with the above, and it should work as long as the [code] blocks haven't been disabled per the optional item in the Instance Security Center.
JarodM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2020 08:52 AM
Pawe, thank you so much, that's exactly what I needed. I also took out the current.update() and it worked. Much appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2020 09:41 AM
No problem at all, the pleasure is all mine!