• Resolved smackey75

    (@smackey75)


    Is it possible to access data in a “related object” to the Salesforce object being synced?

    Apparently Salesforce lets you access the fields of relational objects with formulas using “__r” at the end of the API name instead of “__c”.

    I’m wondering if “object_sync_for_salesforce_pull_params_modify” could be used or some other hook?

    Here are a couple of examples of arrays that I want to add to the salesforce pull query but am not sure how:

    ( SELECT Website_Info__c FROM Online_Platforms__r ),
    ( SELECT Role__c, Talent__r.Name FROM Film_Credits__r )

    Any help would be much appreciated.

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

    (@jonathanstegall)

    If you want to modify the SOQL query that pulls data, consider these hooks. You can filter the SOQL query while it’s still an object before it gets combined, or once it has been converted to a string.

    I haven’t done any accessing of related objects with this plugin and I’m not entirely sure it would work, but I’d be interested to hear if it does. Would definitely put a link to it in the documentation, if there was a working example to share.

    Thread Starter smackey75

    (@smackey75)

    Thanks for your quick reply. The object_sync_for_salesforce_pull_query_modify looks like it could be modified to add to the query, and hopefully include the related object data in the result.

    That said, I’m on a time crunch for the project I’ve inherited which has a custom salesforce to WordPress plugin. It was dated and broken, but I’ve managed to get it working again and it does what I need with related objects so I’m sticking with it.

    I will keep Object Sync for Salesforce in mind for future projects – it’s impressive.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Pulling related objects’ is closed to new replies.