Prevent Salesforce Custom Metadata Text Field Truncation
While working on my Email Invalidation Tool, I ran into Salesforce truncating Custom Metadata text fields at 512 characters. I struggled at first to understand why the static methods – my goto with Custom Metadata – were resulting in broken records. Turns out the solution is simple – use SOQL. The Problem: Salesforce Truncates Custom Metadata Text Fields When loading Salesforce Custom Metadata records using the static methods getInstance() or getAll() long strings are truncated at 255 characters (I actually ran into it at 511, but the documentation says 255). ...