Jump to content
Server Maintenance This Week. ×

Syncing related records


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

Recommended Posts

example:

 

Tables:

Works

workidpk

workerid

 

WorkItems

_workidfk

data

 

If I filter the sync of the Works table (using the exclude field) to be the works of only the workerid associated with the device how do I get Easysync to sync the related workitems records only ?

 

Do I have to store the workerid in the workitems table and filter it accordingly with the exclude field or is there a more efficient way of dealing with that ? Can I link a workitems occurrence to the ES_Works occurrence ?

 

Thanks 

Link to comment
Share on other sites

You have some options, but what will work best for you will depend on your application.

 

One option is to setup the Workitems::ES_Exclude field so that it is a calculation based on the ES_Exclude value of the parent record (in the Works table). That way, if the parent is getting synced, the children would sync as well. You just need to be sure that if the ES_UTC_Time value of the parent is updated, the children's values get changed as well - and vice versa - which is tricky.

 

Another option is to set the value of ES_Exclude via a script, which would be run prior to the sync. I would avoid this if at all possible, because in a multi-user scenario, you would need to consider record locks, etc.

 

-- Tim

Link to comment
Share on other sites

Thanks for the reply.

 

So if I understand correctly, I basically have to filter each tables I want to sync and I can't use the relation to filter children tables ?

 

So , in the OP example I would have:

 

Tables:

Works

workidpk

workeraccount

ES_Exclude (workeraccount<> Get(accountname))

 

WorkItems

_workidfk

data

ES_Exclude (works::workeraccount <> Get(accountname))

 

With this example I don't think I would have to toy with the UTC Time because both tables basically have the same filter....right ?

 

Now I'm wondering what will be the impact on the performance of this method because the Exclude field is an unstored calc.

 

Link to comment
Share on other sites

I would just make the calc for WorkItems::ES_Exclude = Works::ES_Exclude.

 

Yes, it's an unstored calc, so performance might be an issue if you're dealing with larger tables. The other option is to script all of this, but as I mentioned earlier, that presents other issues.

 

-- Tim

Link to comment
Share on other sites

This topic is 3454 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
×
×
  • Create New...

Important Information

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