- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2022 08:20 AM
I want to create a alert notification in service portal.. For example,
If I click HR means I need one alert message ..
Solved! Go to Solution.
- Labels:
-
Service Portal Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2022 09:44 AM
Hi,
create widget as below then you can add it to your portal using page designer.
In this example it will give the open incidents count and make changes as per you are requirement.
HTML:
<div class="button-box" >
<div>
<button type="button" class="btn btn-primary" ng-click="open()">open</button>
</div>
</div>
Client Script:
function($scope) {
$scope.open = function(){
alert($scope.data.task);
}
}
Server Script:
(function(){
var incRec2 = new GlideRecord('incident');
incRec2.addEncodedQuery('active=true');
incRec2.query();
if(incRec2.next()){
data.task = "Total Open Incident are : "+incRec2.getRowCount();
}
})();
Hope it helps!!
Please Mark ✅ Correct, Thanks!!
Regards
Pavankumar
ServiceNow Community MVP 2024.
Thanks,
Pavankumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2022 09:44 AM
Hi,
create widget as below then you can add it to your portal using page designer.
In this example it will give the open incidents count and make changes as per you are requirement.
HTML:
<div class="button-box" >
<div>
<button type="button" class="btn btn-primary" ng-click="open()">open</button>
</div>
</div>
Client Script:
function($scope) {
$scope.open = function(){
alert($scope.data.task);
}
}
Server Script:
(function(){
var incRec2 = new GlideRecord('incident');
incRec2.addEncodedQuery('active=true');
incRec2.query();
if(incRec2.next()){
data.task = "Total Open Incident are : "+incRec2.getRowCount();
}
})();
Hope it helps!!
Please Mark ✅ Correct, Thanks!!
Regards
Pavankumar
ServiceNow Community MVP 2024.
Thanks,
Pavankumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2022 02:27 AM
Hi,
Please close the thread by Mark it ✅ Correct/helpful, if this solves your issue.
Regards
Pavankumar
ServiceNow Community MVP 2024.
Thanks,
Pavankumar