How can I exclude Hr_Case table from cloning from PROD to NON -PROD??

BhupeshG
Tera Guru

I am currently using following sample script to delete in NON -PROD which takes a long time.

 

var gr = new GlideRecord('hr_case')

gr.addQuery('state',4);; //to delete all resolved HR cases

gr.setWorkflow(false);

gr.deleteMultiple();

5 REPLIES 5

Jon Barnes
Kilo Sage

You can go to System Clone > Clone Definition > Exclude Tables on the left hand side in PROD.

 

Add a new record to that table and enter "hr_case" in the name field and submit.

 

This will exclude that table from future clones.

Ashutosh Munot1
Kilo Patron
Kilo Patron

HI,

 

Enter the table name in Exclude table in System clone, clone definition.

 

 

Thanks,

Ashutosh Munot

James Proske
Kilo Expert

How can you do this?  Documentation states "The system cannot exclude tables that extend the Task table and are also flattened into it as part of the table per hierarchy extension model. "

VaranAwesomenow
Mega Sage

There are 3 options

1. Exclude the task table using the exclude tables method suggested by jon barnes, as its not possible to exclude just a child table.

2. Can you use a while loop and use gr.deleteRecord() and see if its quicker ?

3. One  more easy way is to use delete all records option in the table definition, based on experience I feel its quicker compared to script