In a component, I'm returning a list of
ContentNote from the server and displaying the records' data in an
ContentNote.Content (a base64-type field) in the return from the server-side controller causes an internal server error:
return [SELECT Content, Title, CreatedDate FROM ContentNote WHERE Id IN :noteIds ORDER BY CreatedDate DESC];
However, if I remove the
Content field, then the internal server error isn't thrown, and the component inits and renders fine:
return [SELECT Title, CreatedDate FROM ContentNote WHERE Id IN :noteIds ORDER BY CreatedDate DESC];
The documentation states "A server-side action can return any object containing serializable JSON data."
I suspect this is because there's a Salesforce issue serializing the base64
Content field to JSON, but I only know for certain that including the field in the response cause the error.
Is there a specific approach to retrieving a base64 field from the server? I would prefer to keep the attribute in the component a
List<ContentNote>, but I can move to a wrapper class that returns the
Content field decoded as a string if that's the only workaround.