Skip to main content

#SalesforceArchitect1 人正在讨论

I spent weeks debugging an obscure Salesforce internal error that made no sense. 

System.QueryException: Aggregate query has too many rows for direct assignment, use FOR loop 

The query had 5 child records with a Long Text Area field and a few hundred records in a completely separate subquery with only Id selected. 

No LTA. No RTA. Just IDs. 

Yet the query was failing. 

After opening a case with Salesforce Support and escalating to the Product Team, I got the official answer: 

"Working as Designed." 

The Apex runtime applies a shared CLOB budget across ALL child subqueries — even ones with no LTA/RTA fields. The reasoning: heap safety across the entire query tree. 

I wasn't satisfied with that answer. So I ran dozens of tests across different field sizes and record counts and reverse-engineered the internal formula. 

Here's what the runtime actually does: 

Step 1 — sum up all declared LTA/RTA field lengths anywhere in the query (parent + every subquery) 

Step 2 — derive a total children row budget: 

 

FLOOR( 1000 / POW(2, MAX( CEILING(LOG2(totalClobLength / 32768)), 0 )) ) 

Which produces this table: 

totalClobLength | Row budget 

--------------- 

256 B - 32 KB | 1,000 

32–64 KB | 500 

64–128 KB | 250 

128–256 KB | 125 

256–512 KB | 62 

 

Both empirical thresholds I observed matched this formula exactly. 

Here's the flaw. 

The row budget is calculated from LTA/RTA field sizes — and then applied to ALL child records across ALL subqueries, including those that select only Id. 

A subquery like (SELECT Id FROM Children2__r) contributes zero bytes of CLOB content. 

But each of its records still consumes one slot from the budget. 

The budget is asking "how many rows can we safely load given the CLOB volume?" 

Then it counts rows that carry no CLOB data at all toward that answer. 

The fix is straightforward: 

Apply the CLOB row budget only to subqueries that actually select LTA/RTA fields. 

Records in (SELECT Id FROM ...) should not count against a heap limit derived from text field sizes. 

I've submitted this to IdeaExchange: 

"Fix Design Flaw in internal totalClobLength calculation" 

If you've ever hit this error in a multi-relationship query — or you work with contracts, documents, or any domain with rich-text fields on parent objects — please vote. 

https://ideas.salesforce.com/s/idea/a0BHp000017Jka1MAC/fix-design-flaw-in-internal-totalcloblength-calculation

 

#Salesforce #Apex #SalesforceArchitect #SalesforceDeveloper #GovernorLimits

4 条评论
0/9000

#Salesforce Developer #Salesforce Admin #Salesforcearchitects #Salesforceadmins #Salesforce_developer #Salesforce #SalesforceArchitect

Know your org better than the admin who left — OrgSage beta is live

Hey everyone,

How many times have you inherited a Salesforce org and had no idea why things were built the way they were? Or hesitated to delete a field because you weren't sure what would break?

We built OrgSage to answer one question: "What happens if I change this?"

OrgSage connects to your Sandbox or Developer Edition org (quick package install + OAuth — metadata only, never your data) and maps every dependency — fields, flows, triggers, validation rules, permissions — so you can understand what you're working with before you touch anything.

A few things it can do:

→ Ask in plain English: "What breaks if I delete Account.Customer_Tier__c?" and get a full impact analysis — which automations, page layouts, and apex classes reference it

→ Cross-org impact analysis: Connect multiple DEV orgs and see how a change in your workstream impacts another team's org — no more surprise conflicts when workstreams merge

→ Detect automation conflicts — when a Flow and an Apex Trigger both write to the same field, see the execution order and which value actually persists

→ Compare orgs — see exactly what differs between DEV, QA, and Production with severity ratings on every change

→ Map relationships and references better than Schema Builder or "Where is this used?"

Try it at getorgsage.com — just connect a sandbox and start exploring.

We're looking for developers and architects willing to try it and share honest feedback — what's useful, what's broken, and what's missing.

0/9000

🎙️ Episode 1 is on YouTube — De-Fragging the Franken Org 

 

"Your Legacy Org Has Feelings - And We're About to Find Out Why" 

 

Missed the live session? check it here : 

https://www.youtube.com/watch?v=OwmZhPJ1V9Q

 

→ What Agentforce-Ready means in 2026 (no buzzwords) 

→ The 8-Lens modernization framework explained 

→ Org Check + Salesforce Inspector Reloaded + Salesforce CLI — live run 

→ Org Complexity Scorecard built in real time 

→ Final score: 17/40 — and what it means 

 

What's your org's score? Drop it below. 👇 

 

#NoClicksJustVibes #NoClicksJustVibes#NoClicksJustVibes #DeFraggingTheFrankenOrg@Salesforce Developer Group, Dubai, UAE @WFD Partner Cohort: TDX2630DaysChallenge @Agentblazer Community Group @* Salesforce Developers * @Architect Trailblazers

0/9000

🚀 Calling the Salesforce Savvy architects of Tampa! 🚀 

Join us for the second Think Like an Architect Series on Thursday, June 26 at 6:30 PM! 

Put on your Certified Technical Architect (CTA) thinking cap as we dive deep into identity and access protocols? 

@Walter Spinrad

 will lead us through a collaborative case study. Save the date... and your password 🤫 

 

Escape the Salesforce island🏝️ and find Ohana🌺 with your local community members. Don’t miss the opportunity to connect with Tampa’s top Salesforce professionals and train your architect brain 🤯 

👉 RSVP Think Like an Architect Series – June 26

0/9000

🚀 Calling the Salesforce Savvy architects of Tampa! 🚀 

Join us for the second Think Like an Architect Series on Thursday, April 17 at 6:30 PM! 

Put on your Certified Technical Architect (CTA) thinking cap as we decide, To Code or not to Code?

@Walter Spinrad

will lead us through a collaborative case study to ponder this age-old question🤔  

 

Escape the Salesforce island🏝️ and find Ohana🌺 with your local community members. Don’t miss the opportunity to connect with Tampa’s top Salesforce professionals and train your architect brain 🤯 

👉 RSVP Think Like an Architect Series – April 17 

https://lnkd.in/eFHpi2Mj

 

 

 

hashtag

#SalesforceArchitect

 

 

hashtag

#TrailblazerCommunity

 

 

hashtag

#ThinkLikeAnArchitect

 

 

hashtag

#SalesforceTampa

 

 

hashtag

#CTA

 

 

hashtag

#SalesforceEvents

0/9000

🚀 Calling all brilliant minds in Tampa! 🚀

Join us for the first-ever Think Like an Architect Series on Thursday, March 20 at 6:30 PM!

Step into the mind of a Certified Technical Architect (CTA) as we solution a business case study together, led by @Walter Spinrad. Whether you're an aspiring architect or a seasoned expert, you'll gain valuable insights into collaborative solution design and leave with practical takeaways. Don’t miss the opportunity to connect with Tampa’s top Salesforce professionals and train your architect brain 🤯

👉 RSVP now: Think Like an Architect Series – March 20

#SalesforceArchitect #TrailblazerCommunity #CTA 

0/9000

So I decided to take the Salesforce career path test to see where my heart and head are at. Deep down, upon discussing this with an acquaintance, I was sure I wanted to be a Salesforce consultant. I'm not 100% sure of which way to go, but I am sure enjoying this journey of trying new things and doing Hard things. ALX has helped a lot toward this mindset. #Salesforce #SalesforceArchitect #Salesforcearchitects #Salesforceconsultants ALX 

So I decided to take the Salesforce career path test to see where my heart and head are at. Deep down, upon discussing this with an acquaintance, I was sure I wanted to be a Salesforce consultant.

1 条评论
  1. 2024年7月22日 11:25

    Hi, I'm Pietro and I've been 43 for a few weeks now. I've recently decided that I want and need to give my professional life a new twist. It was already clear that it would have something to do with project management, digitalisation and IT. But I'm here now and I'm looking forward to transforming my career with Salesforce. This is how I imagined the path to get there: Associate - AI Associate - Salesforce Administrator - Salesforce Administrato Advanced - Business Analyst.

     

    What do you think? Is this a good career path?

    Hi, I'm Pietro and I've been 43 for a few weeks now. I've recently decided that I want and need to give my professional life a new twist.

0/9000

Using ChatGPT store, you can now build your own GPT! 

 

What I did: Build a custom GPT that reads my Salesforce website. 

And analyze the content (for summary, images, latest posts). 

 

Here's how I did it (pretty easy): 

https://saisocial.substack.com/p/project-build-customized-gpt-to-browser 

 

#salesforcearchitect 

#salesforcecommunity 

Using ChatGPT store, you can now build your own GPT! What I did: Build a custom GPT that reads my Salesforce website. And analyze the content (for summary, images, latest posts).

 

@* Sales Cloud - Best Practices *, @* Salesforce Developers *, @* Salesforce Einstein * @* Salesforce Administrators *

9 条评论
0/9000
0/9000
2 条评论
  1. Tom Bassett (Vera Solutions) Forum Ambassador
    2023年8月17日 18:50

    Wish there was a <3 reaction thanks Stuart!

0/9000