Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sf_query() timeout on queries with more than 260 results #19

Closed
rrmn opened this issue May 15, 2019 · 4 comments
Closed

sf_query() timeout on queries with more than 260 results #19

rrmn opened this issue May 15, 2019 · 4 comments
Assignees
Labels
bug Unintended behavior that should be corrected could not reproduce Could not be reproduced question or help Clarification or help may suffice to resolve

Comments

@rrmn
Copy link

rrmn commented May 15, 2019

Maybe I don't understand SOQL well enough, but I tried below query with a limit of 260 and 270 and received the expected results with the former, a time-out with the latter.

Any ideas?

sf_query("SELECT o.Id, o.Owner.Name, o.LeadSource, o.Name, o.AccountId, o.CreatedDate, o.Probability, o.CloseDate, o.StageName, o.OwnerRole__c, Close_Reason__c, Reference_Opportunity__c, CampaignId, Campaign.Name, 
          (SELECT Id, ...,  FROM OpportunityLineItems) 
          FROM Opportunity o 
          WHERE o.OwnerRole__c like 'Sales%' OR o.OwnerRole__c like 'CustomerSuccess'
          LIMIT 260")

works

sf_query("SELECT o.Id, o.Owner.Name, o.LeadSource, o.Name, o.AccountId, o.CreatedDate, o.Probability, o.CloseDate, o.StageName, o.OwnerRole__c, Close_Reason__c, Reference_Opportunity__c, CampaignId, Campaign.Name, 
          (SELECT Id, ...,  FROM OpportunityLineItems) 
          FROM Opportunity o 
          WHERE o.OwnerRole__c like 'Sales%' OR o.OwnerRole__c like 'CustomerSuccess'
          LIMIT 270")

time-out

@StevenMMortimer StevenMMortimer self-assigned this May 16, 2019
@StevenMMortimer StevenMMortimer added bug Unintended behavior that should be corrected could not reproduce Could not be reproduced question or help Clarification or help may suffice to resolve labels May 16, 2019
@StevenMMortimer
Copy link
Owner

@RomanAbashin Queries are tough to debug for me because I don't have access to your org or your data to see what the root cause of the issue is. There are a few routes to go, all of which depend on the level of data you are allowed to share with me or publically:

  1. You look at the code that's behind sf_query() and run it step-by-step and let me know at which point it is failing.
  2. You take some screenshots and post here or email to me (reportmort@gmail.com) the data or artifacts from running other functions that might point out why it's not completing. For example:
    • What do you see when you set verbose=TRUE argument?
    • What happens if you change the page_size argument?
    • What happens if you try using the "SOAP" API type?
    • What happens if you change your query? I can't tell exactly what fields you're pulling, but it may be possible to write the query in a simpler way. Some objects don't require a subquery to reference related items like you're doing with (SELECT Id, ..., FROM OpportunityLineItems). I recommend using Salesforce's Workbench tool to see how it builds out queries.
  3. You invite me to your organization so I can access the data to test with it.

One last thing, I'm not sure what you mean by "timeout" (e.g. no response after 5 seconds, 60 seconds, 60 minutes, etc.) and whether or not that's an issue on the Salesforce side or the salesforcer package.

@rrmn
Copy link
Author

rrmn commented May 16, 2019

@StevenMMortimer Thanks for the reply. By timeout, I meant no response after 5 minutes of waiting. The same query runs with RForcecom without any problems. I'll dig into the function, though. Thank you!

@StevenMMortimer
Copy link
Owner

@RomanAbashin Please let me know if you're still having issues. Otherwise, I'll close this issue since I can't reproduce or help. Thanks.

@StevenMMortimer
Copy link
Owner

@RomanAbashin Apologize for the extremely long delay. This is well overdue, but finally got to the heart of the issue with some help from #54. This fix is already on GitHub and will be included in the new release of the package (v0.2.0) coming in the next few days. Upgrade your version of {salesforcer} package to (>= 0.1.4.9999) and you should be good to go. Thanks for your patience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unintended behavior that should be corrected could not reproduce Could not be reproduced question or help Clarification or help may suffice to resolve
Projects
None yet
Development

No branches or pull requests

2 participants