- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-08-2018 01:41 PM
Hi,
I have written business rule to show error message when user try to delete a record in the table. Its working fine, I can the error message on the Form.
But When I try to deleted record in the table by Table API in Rest API Explorer, doesn't show error message instead it shows message
"error":\{"detail":"Operation against file 'table name' was aborted by Business Rule 'business rule name^sysid'. Business Rule Stack:Abort Delete-","message":"Operation Failed
How can we show error message in table api?
Regrads,
Upender
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2019 05:54 AM
OOB there is no way to show error message on the table API.
Opened enhancement request with ServiceNow.
Regards,
Upender
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2018 12:39 AM
Hi Upender,
The validation which you are doing in the before delete business rule have the same code in the scripted rest api.
The Table API will show you the message as per the business rule logic you have written.
If you want to have custom message to be sent before deletion then use scripted rest api.
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2018 06:05 AM
Unless something has recently changed, errors in business rules do not output to rest calls. Can you provide an example of this doing this bawiskar? I'd love to see this working the way you describe, but I haven't seen that work this way.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2018 01:04 PM
Hi Ankur,
I tried by creating Scripted Rest API, but no use still I see the same error message.
var del_system = current.u_monitoring_system;
var cluster_name = '';
var gr = new GlideRecord('cmdb_ci_cluster_node');
gr.addQuery('name', current.u_host.name);
gr.addQuery('install_status!=7^ORinstall_status=NULL');
gr.query();
if(gr.next()) {
cluster_name = gr.cluster.name;
//gs.addErrorMessage('name:' + cluster_name );
if(cluster_name != ''){
var mc_gr = new GlideRecord('u_monitoring_collectors');
mc_gr.addEncodedQuery('u_host.name='+cluster_name);
mc_gr.query();
while(mc_gr.next()){
if(mc_gr.u_monitoring_system == del_system){
current.setAbortAction(true);
return 'Error : Custom message ';
}
}
}
}
Regards,
Upender
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2019 05:54 AM
OOB there is no way to show error message on the table API.
Opened enhancement request with ServiceNow.
Regards,
Upender