File tree Expand file tree Collapse file tree 4 files changed +62
-0
lines changed
Modern Development/Service Portal Widgets/My Mentioned Items Expand file tree Collapse file tree 4 files changed +62
-0
lines changed Original file line number Diff line number Diff line change 1+ /*
2+ list css to show border-bottom and padding.
3+ */
4+ li {
5+ padding: 1.2 rem 0 ;
6+ border - bottom : .1 rem solid #DADDE2;
7+ list - style :none ;
8+ }
9+
10+ /*
11+ set background color of widget to white.
12+ */
13+ . main - cont {
14+ background :#ffffff;
15+ }
Original file line number Diff line number Diff line change 1+ < div class = "main-cont" >
2+ < div class = "panel-heading b-b" >
3+ < h2 class = "panel-title ng-binding" > ${ My Mentions } </ h2 >
4+ </ div >
5+ < div >
6+ < div class = "page-container" >
7+ < ul >
8+ < li ng-repeat = "item in data.mentionArr" >
9+ < span > ${ You have been mentioned in } </ span > < a href = { { item . url} } target = "_blank" > { { item . record} } </ a > < span > ${ by } { { item . user_from} } </ span >
10+ </ li >
11+ </ ul >
12+ </ div >
13+ </ div >
14+ </ div >
Original file line number Diff line number Diff line change 1+ ** How to use**
2+ 1 . Add this widget to portal homepage or any other page.
3+ 2 . It will display the top 5 records where user is mentioned in.
4+ 3 . It will also display the user who has mentioned the logged in user.
5+
6+ ** Use Case**
7+ 1 . User will receive the mentioned items on portal homepage.
8+ 2 . User can directly go to the record and reply.
9+ 3 . The link will land the user on tickets page.
10+
11+ <img width =" 338 " height =" 957 " alt =" my mentions " src =" https://github.com/user-attachments/assets/68499e33-8d57-4c08-8228-b152203fbf4e " />
12+
Original file line number Diff line number Diff line change 1+ ( function ( ) {
2+ /*
3+ This code will display the records wher user is mentioned in (@user in Jurnal fields).
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