AnsweredAssumed Answered

Still not getting "Delete Duplicates" script just right

Question asked by DonWest on Mar 26, 2011
Latest reply on Mar 27, 2011 by DonWest

Title

Still not getting "Delete Duplicates" script just right

Post

Followed answer ID 3441, but issue is in the present db the first 3 records are dupes, and the script correctly marks only #2 and #3 with an "X" in the "Mark" field, but then places an "X" in every "Mark" field thereafter. I think I must be missing something on how to tell it that it needs to go to the next set of duplicates and examine/mark.

So here's the scenario.....work order numbers for technicians (text field called "Ticket" containing numbers and letters), this is a unique number, but as the daily work order report may show the same order number from day to day until it's closed, there are numerous duplications of the "Ticket" field, and I want to eliminate them.

Followed script as:

Show All Records

Sort Records [Restore, No Dialog] sort by Ticket in Ascending order

Go to Record/Request/Page [First] 

Replace Field Contents [No dialog, 'Mark', ""]

Loop

Set Field ['Global','Ticket']

Go to Record/Request/Page [Next, Exit after last]

If ['Global' = 'Ticket']

Set Field ['Mark', "X"]

Else

Set Field ['Global', 'Ticket']

End If

End Loop

Perform Find [Restore] Find records when 'Mark' = "X"

It's pretty much word for word  of the script on the help page, but if you follow what I'm seeing...these records for example

1234

1234

1234

6789

6789

etc

etc

The script leaves the first 1234 'Mark' empty and places an "X" in the next two as the script is requesting. But then it places an "X" in 'Mark' for every record thereafter. What am I missing in the script to have it move on to the 6789, decide which of those are dupes, then move on to the next set, etc.?

THANKS

Outcomes