Fix script

Ramanjaneyulu
Tera Contributor

Hi Team,.

 

I have to write a fix script for cleanup duplicate records in custom table production instance.

 

xyz table required inactive duplicate records based on below unique filter criteria:

 

Unique filter criteria: Master ( reference field), country (reference field), priority, assigned to( reference field)

 

Example:

 xyz table having 1000 records total.

100 records tagged to each master 

If I filter with master number then 100 records will come.

And specific country filter = 30 records

Special priority= 15 records

Specific assigned to = 10 records 

 

As per this condition finally i should only one record where as it showing 10 records 

Remaining 9 records are duplicate records.

Those duplicate records needs to inactive.

Keep it active 1 record ( only keep active recently created)

 

The same other assigned to user, other priorities, other countries, other masters records need to very the script and do the cleanup.

 

It's really a tricky scenario for me. 

Can any one please help me in this.

 

 

 

 

Thanks & Regards,

Raman.

 

2 REPLIES 2

AshishKM
Kilo Patron
Kilo Patron

Hi @Ramanjaneyulu , 

Based on the details provided, what's criteria to choose 1 record out of 10 based on that 9 become duplicate and applicable to mark inactive.

 

What's mearning of "100 records tagged to each master ". What is master here ?

 

Can you share some screen shot with data in list view

 

-Thanks,
AshishKM


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution

Hi Ashish,

 

Out of 10 records first we need we can keep recently created record and remaining mark to Inactive.
Master is a reference field which is tagged each master contains multiple records
example purpose i have mentioned 100 records.

We can assume like : incident and problem tagging scenario
Where in the incident table each problem might contains multiple incidents
here problem will work as master