How to remove interaction_m2m_skill table from scoped app?

bachhav
Kilo Guru

I would like to remove interaction_m2m_skill table from scoped app but I am unable to see the delete table option for this table in the studio as this ServiceNow OOB table. 

When I tried to delete the entry from application files, below error occurred: 
"Insufficient rights to delete table interaction_m2m_skill. User does not have delete access." 

I tried with admin & security_admin role but no luck.

Please help me to remove this table from scoped app.

1 ACCEPTED SOLUTION

bachhav
Kilo Guru

I solved this by using below script - 

var choice = new GlideRecord('sys_metadata');
choice.setWorkflow(false);
choice.addEncodedQuery('sys_scope=aaaaaaaa^sys_class_name!=sys_metadata_delete^sys_nameLIKEm2m');
choice.query();
gs.info(choice.getRowCount());
choice.deleteMultiple();
gs.info(choice.getRowCount());

View solution in original post

8 REPLIES 8

bachhav
Kilo Guru

Hi @Runjay Patel,  We got the below review comment from the ServiceNow certification team - 

Table naming convention :

For a Table in scoped application, name is prefixed with a namespace identifier to indicate that it is part of an application. Tables name not having the namespace indicator will lead to uninstallation issue. Please Delete table and Creata a table the tables prefixed with correct namespace identifier. Also update any other places where the table name is being used, like ACL, GlideRecord calls, Choices etc.

Artifact interaction_m2m_skill (sys_db_object_aaaaaaaaf) in the class sys_db_object failed for 'Table naming convention’ check
[Comments]. We noticed this table is somehow captured/ recreating in the application package or while installation, it could be because of any changes to this table in the application package  like a field creation or something ( while devlopment in vendor instance) . Please recheck all the application files and remove things related to this table .

 

@bachhav 

The ServiceNow team is clearly telling that somehow it got captured as application file in your scoped app

Please remove it from your app scope

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

bachhav
Kilo Guru

I tried to remove the application file but it doesn't allow me to delete it.

bachhav
Kilo Guru

I solved this by using below script - 

var choice = new GlideRecord('sys_metadata');
choice.setWorkflow(false);
choice.addEncodedQuery('sys_scope=aaaaaaaa^sys_class_name!=sys_metadata_delete^sys_nameLIKEm2m');
choice.query();
gs.info(choice.getRowCount());
choice.deleteMultiple();
gs.info(choice.getRowCount());