Conditional based on if there is a matching serial number for a record.
I’d like to create a script that compares the serial number of records in an external data source to the serial number of records in my FileMaker database and then deletes the record in the external data source if no matching record is found in the FileMaker db. In this case I'm creating a script that syncs between these two data sources and this portion of the script would delete any "orphan" records that were deleted in my Filemaker database but still exist in the other data source.
What would be the best way to see if there is a record with a matching serial number in my Filemaker database?
To be more specific, I’m using a plugin (Address Book Manipulator http://www.addressbookmanipulator.com/) to update records in my Apple Contacts application.
In essence my script would look something like what’s shown below. I'm just not familiar enough with the Filemaker functions to know how to best implement this.
Go to first address book contact (in the mac Contacts application) Loop Get the value for the Apple Contact’s serial number Search for records in my FileMaker database with a matching serial number. If [no record with a matching serial number is found] Delete the record in the Contacts application End if Go to next Record in the address book application / Exit after Last End Loop
As always, thank you for any help. :)