Need to show an error message only on the classic UI but should not appear on the Service portal sid
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2025 10:51 AM
Hi,
I have a requirement to display the error message if the assignment group is empty only on the classic UI but to hide it on the Service Portal.
Will the below logic work?
if (gs.isInteractive() && gs.getSession().getStackName() !== 'Service Portal') {
gs.addErrorMessage('There is no assignment group');
current.setAbortAction(true);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2025 12:25 PM
Hello @prasannasan
Is it for a catalog form ? Classic UI you mean you are opening the catalog form in native UI ?
Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket.
Regards,
Shivalika
My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194
My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2025 12:28 PM
Its an incident record, and yes, I meant native UI when I mentioned Classic UI
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2025 12:31 PM
It is an incident record. Yes, I meant native UI.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2025 08:03 PM
Hello @prasannasan
Okeh, so you want to restrict any activity if the assignment group is empty and when are you doing that - insertion, during update ?
Client script won't stop any activity, it will just give error message, it will stop only when you are using on submit client script while insertion.
Business rule will only work if you want to abort any further activities. But are you saying that when you are writing general business rule its also working on the portal ? That shouldn't be the case.
Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket.
Regards,
Shivalika
My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194
My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY