Heap Size Limit Attachments Object

  • 2
  • Question
  • Updated 5 years ago
  • Answered
This is solved for me but I am posting in case anyone else runs into it.  It was a beginners error back in the day that just reared its head.  I have a page include with one model where the SObject Type is Attachment.  I was surpassing the JSON heap size limitation and the page was crashing.  After some trial an error I think I have figured out my issue. Basically, I included the field "Body" and if I loaded over 10 records the heap size was surpassed.  Once I removed the body field from the model I was fine.  I believe this is because Body is the attachment in binary so it can be rather large almost like loading the attachments into the page instead of just the links to the attachments. 

Why did I load the body?  I was new and experimenting with which fields displayed what and never removed it from my model when I was learning.  Bottom line don't include the field "Body" on your attachment objects.
Photo of Rich Slack

Rich Slack

  • 4,476 Points 4k badge 2x thumb

Posted 5 years ago

  • 2
Photo of Zach McElrath

Zach McElrath, Employee

  • 56,134 Points 50k badge 2x thumb
Thanks for posting this, Rich, very important point for others who are working with the Attachment object.
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 45,308 Points 20k badge 2x thumb
Thanks for documenting this Rich.  You are right that the Body field in the attachment object is really useless in Skuid, and can contribute to Heap Size errors..  In A Hurry! 
Photo of Matt Sones

Matt Sones, Champion

  • 33,040 Points 20k badge 2x thumb
Thanks! Just ran into the same issue. A quick and easy fix!
Photo of Erik Wahlberg

Erik Wahlberg

  • 2,698 Points 2k badge 2x thumb
Was just researching my issue before making a post about it. Turns out this was exactly my issue so thanks for posting!