
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2020 07:07 AM
I have customized installation exit to modify the error message for failed login attempt. It is working as expected in the main console, but service portal login still displays old message.
Main console:
Service Portal:
I have verified that the new installation exit is invoked for service portal login, but message is incorrect. I would like to display different messages based on account locked_out status. Please assist.
Solved! Go to Solution.
- Labels:
-
Service Portal Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2020 11:43 PM
I was able to fix the issue by adding custom code to server script:
if(input.flag == "true") {
var gr = new GlideRecord("sys_user");
gr.addQuery('user_name', input.username);
gr.query();
if(gr.next()) {
if(gr.locked_out) {
data.customMsg = gs.getMessage("crt_account_locked");
//input.username = '';
}
else {
data.customMsg = gs.getMessage("login_invalid");
}
}
else {
data.customMsg = gs.getMessage("login_invalid");
}
return;
}
Modified the client script as per the screenshot shared by Naveen, but with little more customization:
else {
// wrong username or password
/*c.message = response.data.message;
c.password = "";
c.username = "";*/
c.data.flag = "true";
c.server.update().then(function() {
c.message = c.data.customMsg;
c.password = "";
c.data.username = "";
});
angular.element("#username").focus();
}
Finally add .data to ng-model of username in HTML: ng-model="c.data.username"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2022 04:52 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-22-2022 06:42 AM
Hi Akshaya,
I am facing this same issue but the code you provided doesn't seem to work (but it looks like it should) - can you please assist? Where do you place the code in the widget, etc. may be helpful.
Thank you,
Annie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2022 07:22 AM
Hi Annie,
Place the server script code at the end of your server script. Update the client controller as Akshaya outlined above and do not forget to update all areas in the body HTML template with "c.username" to "c.data.username". That should work, good luck 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-21-2023 10:20 AM
Hi @Community Alums ,
This is working for /sp portal but its not working for /csm portal.
I have checked both portals are using same 'Login' widget still its not working for CSM portal.
Can you please guide me what should I do this to work for CSM portal too?