How to Create Alert / pop up window in service portal ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2020 03:32 AM
Hello All,
I have a widget which takes user name as one input and user id as an another input
I have a requirement where i need to show a "pop up / alert " when the user name field and the user id field matches .
I have done the required validation in server script but no luck in populating the pop up window/alert.
Even we tried using bootstrap and searched in communities still am unable to find the solution.
Quick help will be highly appreciable.
- Labels:
-
Multiple Versions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2020 03:49 AM
Hello,
Have a look on this,
https://serviceportal.io/modal-windows-service-portal/
If answer is helpful please mark correct or helpful!
Thanks,
Pratiksha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2020 03:56 AM
We tried this already but no luck

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2020 12:29 AM
Hi Lakhsmi,
Is it okay to use g_form.addInfoMessage or g_form.addErrorMessage for your requirement. If so we can use them in Client Script of widgets as below:
var g_form = $scope.page.g_form;
g_form.addInfoMessage("<text>");
g_form.addErrorMessage("<text>");
If it helps, please mark ✅ Correct and 👍 Helpful.
Thanks & Regards,
Madhav.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2020 12:54 AM
Hi,
Try this with onChange:
var html='<h1>Matched</h1>';
if((g_form.getValue('user_name') === g_form.getValue('user_id)){
spModal.open({
title: "Test",
message: html,
buttons: [
{label:'OK', primary: true}
],
})..then(function(){
location.href="/sp?id=<required page>;//Comment out if this is onChange use if onSubmit()
});
}
Thanks
Sudhanshu