Jump to content

only sync relevant records


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

Recommended Posts

Hi all,

 

I have a hosted database with department, order and order_items tables which are synced to mobile devices.
We have three departments, each department has a mobile device for order picking.

Orders are always owned by exactly one of those departments, order_items are related to orders, orders are related to departments, nothing fancy.

 

Due to time and my limited knowledge I started last year by syncing all records to all three devices and restrict the records the users can actually see.

This makes the process slow, it's getting slower over time and confuses people when they see that records are being synced when they themselves didn't change anything. I would really like to sync only the records related to the departments.

 

I read through the sync scripts and found I should add the department ID to the calculation in line 14 of 'pull payload' on the client. I can then pick up the deptID as parameter in 'prepare payload for client'.

Next I think I should modify the sql code in line 111 where $dyn_sql gets filled, something along the line of 'select x from y where z AND $deptID = fk_deptID'

 

I would value your opinions on wether or not you think i'm on the right track here and perhaps can someone point me to a place where i can find the right syntax? sql is not easy as it is and filemaker seems to need a lot of extra characters.

 

Thanks for your time, have a good day.

 

Bert

Link to comment
Share on other sites

Yes, you are on the right track. If the records carry a department ID and you have some way of identifying users and linking them with department IDs you can do that. 

The general strategy is to put as little as possible onto the mobile device and transfer only what is required. You can control direction too, with push and pull prefixes on your table names. For instance, you orders and order_items should be PUSH only, unless you have some reason for everybody to see orders made by others.

For assistance with SQL, Search online for FileMaker and executeSQL resources. SeedCode produced a nice helper tool and Beverley Voth wrote a manual that's available from the FileMaker Hacks site.

 

  • Like 1
Link to comment
Share on other sites

This topic is 2747 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.