unable to delete csm custom tables , restricting business rule unable to deactivate

Not applicable

Hi All,

I was trying to delete csm custom tables getting below error and i unable to active false that BR. kindly suggesst

var gr = new GlideRecord('sys_db_object');
gr.addQuery('sys_id','0a9b23c5db48ec90765427360596196d');
gr.query();

if(gr.next()) {

gr.deleteRecord();
}


Validate Table Delete - BR

Operation against file 'sys_db_object' was aborted by Business Rule 'Validate Table Delete^0a9b23c5db48ec90765427360596196d'. Business Rule Stack:Validate Table Delete
Background message, type:error, message: Insufficient rights to delete table sn_customerservice_stakeholders. User does not have delete access.

 kindly help me to delete this

 

 

 

1 ACCEPTED SOLUTION

Hi,

if that custom table is created in Customer Service Management i.e. CSM scope as I could see with the prefix.

Then you cannot delete custom table created within an installed Scoped System Application.

There is known issue for this.

KB Article: KB0623901

Solution: You can use below script and run in scripts background in global scope. Ensure you put your table name

var tableDeletion = new TableUtils();
tableDeletion.dropAndClean('sn_customerservice_stakeholders');

Note: Running this script will permanently delete table and all its data.

Do check my blog as well related to this

Delete Custom table created in installed Scoped System Application

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

6 REPLIES 6

Hi,

if that custom table is created in Customer Service Management i.e. CSM scope as I could see with the prefix.

Then you cannot delete custom table created within an installed Scoped System Application.

There is known issue for this.

KB Article: KB0623901

Solution: You can use below script and run in scripts background in global scope. Ensure you put your table name

var tableDeletion = new TableUtils();
tableDeletion.dropAndClean('sn_customerservice_stakeholders');

Note: Running this script will permanently delete table and all its data.

Do check my blog as well related to this

Delete Custom table created in installed Scoped System Application

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Ankur Bawiskar
Tera Patron
Tera Patron

Hope you are doing good.

Let me know if I have answered your question.

If so, please mark appropriate response as correct & helpful so that this thread can be closed and others can be benefited by this.

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader