• John Biundo 9
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies

Hi developer community,

I am using node.js and the JSforce library.  I am trying to build a report using a few rules to identify the last valid activity on an account.  My SOQL query looks like this:
SELECT Id,
(SELECT OwnerId, ActivityDate, Status, ActivityType, ActivitySubtype, Subject, LastModifiedDate
FROM ActivityHistories
WHERE OwnerId IN (<list of ids>)
AND ActivityDate > <earliest-date>
AND ActivityDate < <latest-date>
ORDER BY ActivityDate desc)
FROM Account

This query sometimes runs to completion, but often terminates with the following error:
{ [Error: socket hang up] code: 'ECONNRESET' }

I have searched around and the best information I get seems to indicate that "this just happens sometimes".  I'm wondering if anyone has any more specific advice on troubleshooting or solving this problem.

A little experimentation seems to indicate that the query may be too complex (though again, it's odd that it only fails some (most) of the time).  This conclusion comes from the fact that simplifying the query, so that I simply get ALL the history for each account, seems to fail less (so far, it's succeeded every time, knock on wood).  This gives me a possible workaround, though I end up getting back a LOT more data and doing a lot more processing on the client than if I were to just get the subset I would get in the original SOQL shown above.  Plus, I would think that (aside form a possible longer "query optimization" phase, the more refined query would put less burden on the salesforce servers.

So long story short, I'd love to find a way to be able to process the above query in a reliable, robust way.

Any ideas, suggestions, etc would be very welcome!

Hi developer community,

I am using node.js and the JSforce library.  I am trying to build a report using a few rules to identify the last valid activity on an account.  My SOQL query looks like this:
SELECT Id,
(SELECT OwnerId, ActivityDate, Status, ActivityType, ActivitySubtype, Subject, LastModifiedDate
FROM ActivityHistories
WHERE OwnerId IN (<list of ids>)
AND ActivityDate > <earliest-date>
AND ActivityDate < <latest-date>
ORDER BY ActivityDate desc)
FROM Account

This query sometimes runs to completion, but often terminates with the following error:
{ [Error: socket hang up] code: 'ECONNRESET' }

I have searched around and the best information I get seems to indicate that "this just happens sometimes".  I'm wondering if anyone has any more specific advice on troubleshooting or solving this problem.

A little experimentation seems to indicate that the query may be too complex (though again, it's odd that it only fails some (most) of the time).  This conclusion comes from the fact that simplifying the query, so that I simply get ALL the history for each account, seems to fail less (so far, it's succeeded every time, knock on wood).  This gives me a possible workaround, though I end up getting back a LOT more data and doing a lot more processing on the client than if I were to just get the subset I would get in the original SOQL shown above.  Plus, I would think that (aside form a possible longer "query optimization" phase, the more refined query would put less burden on the salesforce servers.

So long story short, I'd love to find a way to be able to process the above query in a reliable, robust way.

Any ideas, suggestions, etc would be very welcome!