File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Modern Development/Service Portal Widgets/My Mentioned Items Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 1+ ( function ( ) {
2+ /*
3+ This code will get display the records wher user is mentioned.
4+ This will also provide the link to record.
5+ Only top 5 mentions will be displayed.
6+ */
7+ data . mentionArr = [ ] ; // array to store mentions.
8+ var mentionRec = new GlideRecord ( 'live_notification' ) ;
9+ mentionRec . addEncodedQuery ( 'user=' + gs . getUserID ( ) ) ; // get only logged-in user's records
10+ mentionRec . orderBy ( 'sys_created_on' ) ; // get by created date.
11+ mentionRec . setLimit ( 5 ) ;
12+ mentionRec . query ( ) ;
13+ while ( mentionRec . next ( ) ) {
14+ tempval = { } ; // temp object.
15+ tempval . record = mentionRec . getValue ( 'title' ) ;
16+ tempval . user = mentionRec . user . name . toString ( ) ;
17+ tempval . user_from = mentionRec . user_from . name . toString ( ) ;
18+ tempval . url = '/' + $sp . getValue ( 'url_suffix' ) + '?id=ticket&sys_id=' + mentionRec . getValue ( 'document' ) + '&table=' + mentionRec . getValue ( 'table' ) ;
19+ data . mentionArr . push ( tempval ) ;
20+ }
21+ } ) ( ) ;
You can’t perform that action at this time.
0 commit comments