Jump to content

Insertion of the same record on 2 devices


sfpx
 Share

This topic is 2580 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Did not know how to phrase it so sorry for the title :)

 

How to manage this example situation :

 

1.User A and B are both offline

2.They both create the same Client

3.They both invoice the same new created Client.

 

How to merge all this on the sync ?

 

I tried to change the primary key to  insert the name at the creation instead of an UUID but when I sync there is a duplicate entry error.

 

Thanks

Link to comment
Share on other sites

That's a good question.

 

First thing: Don't change the primary key of any existing records! That is why you're getting the duplicate.

 

Instead, your de-duplication script should change the foreign keys for the invoices so that they point to the client record that you want to keep, and then delete the other client record that you want to get rid of. This is the same process that you would use if you were not using MirrorSync.

Link to comment
Share on other sites

This topic is 2580 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Who Viewed the Topic

    1 member has viewed this topic:
    camacorp 
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.