• Vital Aza
  • NEWBIE
  • 30 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 1
    Replies
Consider the following transaction:

AggregateResult[] x = 
[SELECT SellToCust__r.Id,  SUM(InvAmount__c) 
FROM Invoice__c 
WHERE InvDate__c >= 2023-01-01 AND InvDate__c <= 2023-08-31 
GROUP BY SellToCust__r.Id
HAVING SUM(InvAmount__c) >= 2000];

where SellToCust__c is the field that relates an invoice__c (child) to the corresponding Account.

If I try this in an anon block of code I run against the 50,000 row limit. Batch Apex cannot handle results from such SOQL queries. If I try, for example, to simplify the query and then do the grouping etc. myself in Batchable execute() and finish() methods, I run into the heap size issue.

How would you approach this issue?
I am a novice developer and I find that I spend as much time writing logic as looking for ways to work around governor limits. Anyone else?
I am importing Contact records with Data Loader:
at record insertion, if AccountId (not required) is null then look up the Id of the related Account based on its AccountNumber, which is provided in the csv as an extra field.

I know this sounds like a Flow, but what type, formula, general logic?

Thank you.
I use DataLoader 58.0.0 to extract Contact records with their related  AttachedContentNotes. TextPreview contains just that, a preview. ContentDocumentId refers to a ContentNote record -- fine. ContentNote's Content field, however, shows a file path like /services/data/v57.0/sobjects/ContentNote/[some Id]/Content 

A path relative to what? I am trying to get to the actual body of the message. I am aware of base64 encoding (btw how would you decode that in SOQL? It's all I can feed to DataLoader as far as I can tell).

Newbie here. Thank you in advance for your help.

 
total newbie here.
1-run query
2-results appear in new tab
3-(do something that would change the query results)
4-rerun query
5-show new results in new tab.

How?
I am importing Contact records with Data Loader:
at record insertion, if AccountId (not required) is null then look up the Id of the related Account based on its AccountNumber, which is provided in the csv as an extra field.

I know this sounds like a Flow, but what type, formula, general logic?

Thank you.