Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jun 25 00:44
    dustinwalker opened #4
  • Apr 22 19:03
    nateiler closed #3
  • Apr 22 19:03
    nateiler commented #3
  • Apr 22 18:59
    nateiler edited #3
  • Apr 22 18:59
    nateiler edited #3
  • Apr 22 18:59
    nateiler opened #3
  • Feb 04 2020 03:58
    richardfrankza commented #2
  • Feb 04 2020 03:57
    richardfrankza commented #2
  • Feb 03 2020 18:47
    nateiler commented #2
  • Feb 02 2020 16:00
    richardfrankza opened #2
  • Jan 31 2020 03:39

    nateiler on 1.3.2

    (compare)

  • Jan 31 2020 03:39

    nateiler on master

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

  • Jan 31 2020 03:39

    nateiler on develop

    1.3.2 prep (compare)

  • Jan 30 2020 22:54

    nateiler on develop

    adding password to test db conn… (compare)

  • Jan 30 2020 22:50

    nateiler on develop

    reverting readme (compare)

  • Jan 30 2020 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
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 :)
Catherine Kleimeier
@cakleimeier

Hi! I'm looking to set up a very simple Salesforce SSO flow, and the documentation from Salesforce has me more confused than necessary. I'm hoping you could shed some light on how I might go about setting up this flow:

  • From Craft site, non-signed-in (on Craft or Salesforce) user clicks "Sign In" button
  • User is taken to Salesforce sign-in page, signs in
  • User is redirected back to Craft site with minimal information (signed-in status)

Any tips on how I can get started? I've tried creating a Connected App in Salesforce and using the Identity Provider tab's "Issuer" and "Salesforce Identity" urls, but to no avail.

Nate Iler
@nateiler
Hi Catherine, unfortunately the Salesforce connector doesn't support any SSO flows. Its primary objective is to connect to various objects via the RESTful api. SSO requires a layer of security and trust between the two entities which falls outside the scope of the plugin.
We do have another plugin specifically for SSO (https://plugins.craftcms.com/saml-sp) however I'm not sure Salesforce can act as an identity provider or supports SAML which is required for the plugin.
Catherine Kleimeier
@cakleimeier
Hi Nate, thank you for getting back to me and for the information. Now that I know this, I can start looking into other solutions. Thank you!
Catherine Kleimeier
@cakleimeier

Hi again, Nate! It turns out that I had misunderstood the client requirements and SSO was not necessary, so I was able to successfully set up an OAuth flow with this plugin.

However, this has lead me to another question: the Patron plugin generates a new file in config/project/plugins/patron/tokens for each new access token. I'm under the impression that every time a user goes through this flow and authorizes my app via OAuth, it will generate a new token and, therefore, a new project config file. This would cause un-version-able project changes, which I anticipate being difficult to work with.

Is there some way to work around that issue? Or to disable a new file from being created for each token? Or I am missing something?

Thanks for your help and your time!