only last comment should be displayed in work notes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2023 02:03 AM
Only last comment should be displayed to the Requester in work notes field (A separate field on request to store the last comments) Other Activity should not be displayed.
I have below requirement where i shouldn't allow requester not to see the activity filter or other activity on request.
for this i have created a field called last comment and written below scripts.
Created a display business rule which fills a scratchpad value with the last comment.
function(current) {
g_scratchpad.lastWorknote = current.work_notes.getJournalEntry(1); })(current);
And a onload Client script:
if (g_scratchpad.lastWorknote){g_form.setValue('u_last_worknote', g_scratchpad.lastWorknote);}
I'm not able to hide activities filtered or activity log for the requester. please can someone help me how to hide activity log and display last comment field on the request.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2023 11:03 AM
Where are you trying to run it? On portal? I'd imagine it should work on any instance as it works on my PDI's incidents. I didn't try it on requests, so those might be a bit different.
If you right click the comment in the activity log and select inspect, you should be able to view the HTML structure of the activity log. The data changes are shown in an ul element and all comments should be in li elements that have a div with class "sn-widget-textblock" in them.
If that is different then you can use whatever class you might have on them.