Issue with redirection on case
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Hi,
I have created one business rule so when i am testing that on case form sometimes that is redirecting to another page so how to stop redirection
Before/Inser, update
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
hey @mania
add client script also
function onSubmit() {
var workNoteType = g_form.getValue('u_work_note_type');
var emailNotification = g_form.getValue('u_email_noti_type');
if (workNoteType === 'Customer Communication' && emailNotification === 'internal') {
g_form.addErrorMessage(
'Internal email notification is not allowed for Customer Communication.'
);
return false; // Stops save — NO redirect
}
return true;
}
*************************************************************************************************************
If this response helps, please mark it as Accept as Solution and Helpful.
Doing so helps others in the community and encourages me to keep contributing.
Regards
Vaishali Singh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
hey @mania
try this business rule
(function executeRule(current, previous) {
if (!gs.isInteractive()) {
return;
}
var workNoteType = current.u_work_note_type + '';
var emailNotification = current.u_email_noti_type + '';
if (workNoteType == 'Customer Communication' && emailNotification == 'internal') {
gs.addErrorMessage(gs.getProperty('case.worknote.customer.internal.error'));
current.setAbortAction(true);
}
})(current, previous);
*************************************************************************************************************
If this response helps, please mark it as Accept as Solution and Helpful.
Doing so helps others in the community and encourages me to keep contributing.
Regards
Vaishali Singh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
42m ago
business rule is on which table?
what's your actual business requirement?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
