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