Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Feb 04 03:58
    richardfrankza commented #2
  • Feb 04 03:57
    richardfrankza commented #2
  • Feb 03 18:47
    nateiler commented #2
  • Feb 02 16:00
    richardfrankza opened #2
  • Jan 31 03:39

    nateiler on 1.3.2

    (compare)

  • Jan 31 03:39

    nateiler on master

    syncing enhancements reverting readme adding password to test db conn… and 1 more (compare)

  • Jan 31 03:39

    nateiler on develop

    1.3.2 prep (compare)

  • Jan 30 22:54

    nateiler on develop

    adding password to test db conn… (compare)

  • Jan 30 22:50

    nateiler on develop

    reverting readme (compare)

  • Jan 30 22:47

    nateiler on develop

    syncing enhancements (compare)

  • Nov 01 2019 05:13
    davecoggins closed #1
  • Nov 01 2019 05:13
    davecoggins commented #1
  • Oct 31 2019 17:46
    nateiler commented #1
  • Oct 31 2019 06:17
    davecoggins commented #1
  • Oct 30 2019 17:58
    nateiler commented #1
  • Oct 30 2019 09:58
    davecoggins opened #1
  • Sep 30 2019 21:03

    nateiler on gh-pages

    Deploy salesforce.flipboxfactor… (compare)

  • Sep 30 2019 21:03

    nateiler on gh-pages

    Deploy salesforce.flipboxfactor… (compare)

  • Sep 30 2019 21:00

    nateiler on 1.3.1

    (compare)

  • Sep 30 2019 21:00

    nateiler on master

    disable attachment/document dow… allow override of download acce… adjusting override condition and 1 more (compare)

cdfwebsolutions
@cdfwebsolutions
Hi - is it possible to use craft-salesforce to pull SF query results directly into a template? We've successfully set up our connection to SF and run a test query in the CP, but have not been able to figure out how to use the template tags from the plugin to display results in a template. The getObject and getQuery methods seem to return criteria but not data results.
Nate Iler
@nateiler
Hi @cdfwebsolutions, it is and you're on the right track. One option would be to use one of the queries build in the admin. That would something like {% set results = craft.salesforce.query.fetch({handle: YOURHANDLE}) %}
Or you can build your own query via {% set results = craft.salesforce.query.fetch({query: 'SELECT Id, Name FROM Account'}) %}
cdfwebsolutions
@cdfwebsolutions
I just tried both of those approaches, but I get an error: "Calling unknown method: flipbox\craft\salesforce\queries\SOQLQuery::fetch()" ... is that syntax definitely correct?
Nate Iler
@nateiler
Sorry, I'm going from memory (at a conference).
{% set criteria = craft.salesforce.criteria.query({handle: YOURHANDLE}) %} Should give you a 'Criteria' object.
{% set results = criteria.fetch() %} Should give you an http response
{% model = craft.salesforce.transform(results) %} should transform the HTTP response into a more usable model
Nate Iler
@nateiler
Hopefully that should work for you.
cdfwebsolutions
@cdfwebsolutions
That did the trick! thanks so much :)
Nate Iler
@nateiler
Great. Open to any feedback that you may have as well.
cdfwebsolutions
@cdfwebsolutions

FYI, I was able to pull a basic test list using the following:
{% set query = "SELECT Id, Name, Email, Account.Id FROM Contact" %}
{% set criteria = craft.salesforce.criteria.query({query: query}) %}
{% set results = criteria.fetch() %}
{% set model = craft.salesforce.transform(results) %}

{% for record in model.records %}
<p><strong>{{ record.Name }}</strong> <br>
{{ record.Email }}</p>
{% endfor %}

cdfwebsolutions
@cdfwebsolutions
(using the handle also worked)
We noticed that SF limits SOQL queries to 2000 records. Is there a way to paginate results and loop thru some kind of offset to retrieve all records?
cdfwebsolutions
@cdfwebsolutions
Also, ultimately, our goal is to sync updates of Craft User data (perhaps based on the SF ID) between Craft and SF. I imagine this will require some custom dev on our part but if you have any guidance generally to the approach (in terms of leveraging your plugin) it would be much appreciated. Is this the kind of project you might be interested in working on? (It's a small non-profit clients, so we've been looking to leverage as much off the shelf as possible.)
Thanks again :)