function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Syed Abid ShahSyed Abid Shah 

What is timed out error & 'o' in SOQL query like Select o.OpportunityId

Hi Folks,

I am runnign a daily extract file however from yesterday onwards it is throwing 'TIMED OUT' error.
Belwo is the SOQL query:
"Select o.OpportunityId, o.OldValue, o.NewValue, o.IsDeleted, o.Id, o.Field,o.CreatedDate, o.CreatedById From OpportunityFieldHistory o where o.Field ='StageName'"/>"
Here I would like to know what action needs to be consider here if it throws such timed out error.exceptionMessage='Your query request was running for too long.''.
secondly I dont understand from above query what that 'o' represents here?

Regards
Syed
Abdul KhatriAbdul Khatri
"o" represent the Alias. You can get the help with this link
https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_alias.htm

You are getting timed out error because you SOQL is returning too much data probably crossing the Governance Limit, so in order to fix you can do any of the following.
  1. include LIMIT 49999 in the SOQL or whatever less than that
  2. Add another filter with AND operator like Id = :<IdListField> 
Goal is to limit the SOQL as per the requirement.

I hope this help.
Syed Abid ShahSyed Abid Shah
Thanks for reply Abdul Khatri,

Here we are receiving file daily and its size remains 47 MB...do you think its due to increase in size all of a sudden?
Abdul KhatriAbdul Khatri
I just gave my perspective on the exception you provided or also based on the SOQL you provided since you are only have one filter there looking at the field "StageName", there is a possibility that data increase in the object which ultimately effect the SOQL. I am also not sure how are you running daily extract Manual or Automation.

Anyhow bottom line try to run your process in different batches (possible based on dates) if you expecting increase of data daily.
Abdul KhatriAbdul Khatri
Let me know if I was of helpful anyway
Abdul KhatriAbdul Khatri
Have you got it resolved? Any help you got from here?
Abdul KhatriAbdul Khatri
Man you should follow up your tickets at least letting us know if we were able to helped or not. Thanks.
Syed Abid ShahSyed Abid Shah
Hi Abdul,

I apologies , I was engaged with with some other activity.
I really appreciate your response on this, your solution really helped us.. Please go ahead and resolve this case.

Thanks again
Syed
Abdul KhatriAbdul Khatri
Sorry for the delay but this is something you can do, mark this best please