• Resolved chercka

    (@chercka)


    Is it possible to conditionally sync objects from SF to WP?
    I don’t see it as a fieldmap option.

    Specifically I’d like to only sync SF Users into a WP Custom Post Type if the SF user has certain fields set.
    For example only pull into WP the SF users that have roleID === X?

    Ignore all the others.

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Jonathan Stegall

    (@jonathanstegall)

    It is, but only with developer hooks. I don’t really provide support for the developer hooks here, but there is documentation about how you might do this specific thing. See this page.

    Thread Starter chercka

    (@chercka)

    Thanks Jonathan!

    I have a question about the hook you referred to, Jonathan. Do the fields have to be in the fieldmap for the conditionals to work? I will need to use this functionality. However, I don’t necessarily need to store that information. Just need to check it to see if the given record should be imported.

    Plugin Author Jonathan Stegall

    (@jonathanstegall)

    @blipps good question. You could try it and see, but I think by default it probably would need to be in the fieldmap because $object is the result of a Salesforce API call that uses the fields in the fieldmap.

    If that’s correct, I think if you wanted to, you could use object_sync_for_salesforce_pull_query_modify to modify the query and add those other fields in to the resultset, and then use object_sync_for_salesforce_pull_object_allowed to work with those fields. I’d test it a lot, but it is probably possible.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Conditionally syncing’ is closed to new replies.