Alert option on Client Controller Portal widget
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-18-2023 06:20 AM - edited ‎01-18-2023 06:27 AM
Hello All,
I currently have an alert message that opens up for confirmation of deactivating a User.
However it shows up the message with instance URL as shown below
However I do not want to popup the message that way with the URL. And here is my script below. Can someone please help to achieve this from a different pov.
Client
c.deactivateUser=function(name)
{
//alert("User will be deactivated");
if(confirm("Are you sure you want to deactivate the user?") == true){
c.data.username = name;
c.server.update().then(function(){
c.data.action='proceed';
});
} else {
alert("User was not deactivated.");
}
}
Also I need cancel option which is not available currently
HTML
<li><a href="javascript:void(0);" ng-click="c.deactivateUser(user.sys_id)">Deactivate User</a></li>
TIA/.
@Ankur Bawiskar @jaheerhattiwale @Community Alums @RaghavSh @Mark Roethof
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2023 10:08 PM
@DPrasna Check the below youtube video
Please mark as correct answer if this solves your issue.
ServiceNow Community Rising Star, Class of 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-17-2025 01:05 AM
https://www.servicenow.com/docs/bundle/yokohama-api-reference/page/app-store/dev_portal/API_referenc...
Please refer to this link.
you can use spModel if you pass it in your client function.
spModal.alert('How do you feel today?').then(function (answer) {
c.simple = answer;
});