Delete records from scoped application

Arun Chauhan
Giga Contributor

Hello,

We are publishing one of our integration application to ServiceNow store. To publish the application on the store, I am retrieving the update set XML on the ServiceNow instance. I am facing an issue while retrieving.

 Whenever I retrieve the update set XML, I can see some unwanted records in the ‘Application Files’ list. These records are created by default and I am not able to delete these. Please check below screenshot:

find_real_file.png

 I tried deleting them through Background scripts and Fix scripts but I am not able to delete these. Please note these records belongs to 'Table Subscription Configuration' table. Below is my script:

var gr = new GlideRecord('ua_table_licensing_config');
gr.addQuery('sys_id', '105693784f25d34078c5fd218110c794');
gr.query();
while (gr.next()) {
gs.debug("Deleting record with name : " + gr.name.toString());
gr.deleteRecord();
}

Even I added ‘Can delete’ in the Application Access for ‘Table Subscription Configuration’ table and added an ACL with ‘admin’ role on the table with delete operation. But the errors remains same.

I am getting below error :

*** Script: [DEBUG] Deleting record with name : x_sapo_iiq_catalog_spnt_transactions

Background message, type:error, message: Invalid delete of subscription management attributes

Please suggest.

 

1 ACCEPTED SOLUTION

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hello Arun,

 

You can either deactivate the records (If you have active checkbox) or move them to global scope if this is not required in your application scope.

 

Thanks,

Pradeep Sharma

View solution in original post

7 REPLIES 7

rammohanraomadd
Kilo Guru

Hi,

 

Can you select a record and try to delete it manually.

 

Regards,

Ram m

I am not able to delete it manually.

Hi,

 

What is the error that you are receiving. If delete option itself is not visible, please check for the existing delete ACL.

 

Regards,

Ram M

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hello Arun,

 

You can either deactivate the records (If you have active checkbox) or move them to global scope if this is not required in your application scope.

 

Thanks,

Pradeep Sharma