AnsweredAssumed Answered

Finding and omitting matching records

Question asked by trialuser1111 on Feb 2, 2010
Latest reply on Feb 3, 2010 by trialuser1111

Title

Finding and omitting matching records

Post

I am having trouble with a script meant to identify and omit matching records from a search.  The idea is for the script's search to return all the addresses for the various contacts of a given company, and then go through and delete matching records so all I am left with are unique choices--one record for each address.

 

Here is my current script:

 

Set Variable [$ID; Contacts::CompanyID]

Go to Layout ["Address Chooser"]

Enter Find Mode []

Set Field [Contacts::CompanyID; $ID]

Perform Find []

Go to Record [First]

Loop

   Set Variable [$first; Contacts::Address]

   Go to Record [Next; exit after last]

   Loop

      Set Variable [$second; Contacts::Address]

      If [$first = $second]

         Omit Record

      End If

   End Loop

End Loop

 

Theoretically, the first address should be comparing and omitting records until there is no longer a match, and then the second address becomes the new base for comparison and moves on through the results until finished.

 

I'd appreciate any ideas to execute this more simply or just how to troubleshoot the script if in fact I'm going at this the right way (just incorrectly).

 

Thanks everyone 

Outcomes