0

If I want to dynamically set a filter to my SOQL in the usersyncs.json definition (see below, what to sync down only the contacts that I own), what is the best way for doing this? I know I can add a sync via code, but prefer doing this via config. Would a possible solution is to set this initial config first, and I change the SOQL in code in run time?

{
  "syncs": [
    {
      "syncName": "syncDownContacts",
      "syncType": "syncDown",
      "soupName": "contacts",
      "target": {"type":"soql", "query":"SELECT Id, Name FROM Contact WHERE **OwnerId = XXXX**"},
      "options": {"mergeMode":"OVERWRITE"}
    }
}
1

The soql of the SoqlSyncDownTarget cannot be changed (otherwise the meaning of doing a re sync or a clean sync ghosts would be hard to define).

If you need to dynamically change the filter, you should define a new sync (programmatically).

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.