How to override abort action error message
This content was last updated in 2024. It may still be useful, but could contain outdated information. Please confirm its accuracy before relying on it.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2024 03:55 AM - edited 05-22-2024 02:10 AM
Trying to abort insert action if a record already exists with the same condition with a before insert BR.
The action is getting aborted but the system is not showing the error message which I added in the script, instead it shows system generated error message.
How can I override that error message.
// Add your code here
var getHRCase = new GlideRecord('sn_hr_core_case_workforce_admin');
getHRCase.addEncodedQuery('active=true^hr_service=a677b1eb47ad0dd41a1136dbd36d433b^subject_person=' + current.subject_person);
getHRCase.query();
if (getHRCase.next()) {
gs.addErrorMessage("Error: Resignation request already exist, new request cannot be raised");
current.setAbortAction(true);
}
0 REPLIES 0