Help with simple find script
I'm trying to write a find script that loops through all database records and finds records that have the matching ID. When I get to the Perform Find script step it always ends up not finding any matching records, even though I've verified that that there are matching records for the data by performing manual finds using the same information. I'm assuming that I'm doing something incorrect with the Perform Find script step.
Set Error Capture [ On ] #Opens the First Address Book record and gets the UIDSet Field [ Main::gCurrentRecord; PCAB_OpenFirstRecord ] Loop #Test to make it is a good recordExit Loop If [ LeftWords(Main::gCurrentRecord; 1) = "!!ERROR" or LeftWords(Main::gCurrentRecord ; 1) = "END" ] #Not sure if I need this but am making a variable that that matches the search criteria in case I need to use that instead of a field data.Set Variable [ $contactABID; Value:Main::gCurrentRecord ] Show All Records Go to Layout [ “Find Matching ABID” (Contacts) ] EnterFindMode[ ] [ Pause ] Perform Find [ Specified Find Requests: Find Records; Criteria: Contacts::Address Book ID: “= $ContactABID” ] [ Restore ] If [ Get(FoundCount) = 0 ] #Will Perform some actions here Show Custom Dialog [ Message: "No Matching Record"; Default Button: “OK”, Commit: “Yes”; Button 2: “Cancel”, Commit: “No” ] End IfSet Variable [ $counter; Value:$counter +1 ] #Opens the next record in Address Book and gets the UIDSet Field [ Main::gCurrentRecord; PCAB_OpenNextRecord ] End Loop
Thanks in advance for any help. :)