mdavis6537 Posted September 21, 2015 Share Posted September 21, 2015 For whatever reason I still run into issues with duplicate records every so often. My question is, if I get an error message saying one of my offline users on an iPad has a duplicate record and I go in and change the primary key to something different in my online database, will mirrorsync update that record for the offline user during the sync, thereby clearing the duplicate? Or will it skip that table completely when it detects the duplicate in the offline database? Thanks. Link to comment Share on other sites More sharing options...
Jesse Barnum Posted September 21, 2015 Share Posted September 21, 2015 The latter - it will not attempt to sync any table that has duplicate primary keys. Are you using MirrorSync-managed or developer-managed keys? 1 Link to comment Share on other sites More sharing options...
mdavis6537 Posted September 21, 2015 Author Share Posted September 21, 2015 Thanks Jesse, that is what I figured - darn. I am using MirrorSync managed keys. Its weird because this table rarely ever has anything written or deleted in it - its data that is referenced but barely ever changed so no idea how it got a duplicate entry. Thanks for the quick reply. Link to comment Share on other sites More sharing options...
Jesse Barnum Posted September 21, 2015 Share Posted September 21, 2015 Are there any scripted imports in your solution? With MirrorSync-managed keys, MirrorSync never writes to the primary key at all - it just uses whatever auto-enter values FileMaker assigns. 1 Link to comment Share on other sites More sharing options...
mdavis6537 Posted September 21, 2015 Author Share Posted September 21, 2015 Yep there are, I have a script I run every time I send out a new version that exports and imports all the data. Could that confuse mirrorsync possibly when that happens? I am always sure to set the primary key "next value". Basically I import the records table by table, then sort them and get the highest primary key, then add 1000 to it to make sure to account for any possible offline records that might not have been synced yet, and I set that as the new "next primary key". Link to comment Share on other sites More sharing options...
Jesse Barnum Posted September 21, 2015 Share Posted September 21, 2015 My guess is that something with that scripted import is leading to duplicate serial numbers. I doubt that MirrorSync is involved at all, but if you want to be 100% certain, you can create a calculated field equal to the primary key, and use that as your MirrorSync serial number. That way, MirrorSync can't possible overwrite the primary key with another value. Link to comment Share on other sites More sharing options...
mdavis6537 Posted September 21, 2015 Author Share Posted September 21, 2015 Ok I may try that. I was also thinking about adding in a quick find check after my import to make sure there are no duplicates and throw and error if there are. Thanks for your help. Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 3267 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now