Failed to load document issue in Salesforce

Failed to load document issue in Salesforce

If you face “Failed to load document issue in Salesforce” issue, try the below code for attachment body.

Attachment att = new Attachment();
att.Body = Blob.toPDF(strVar);


Other troubleshooting steps are

1. Check the HTML formation.

2. Check whether the content type is assigned to the attachment.

3. Debug the body of the attachment.

Usually due to Blob.ValueOf(), we face “Failed to load document issue in Salesforce” issue.

Cheers!!!

Leave a Reply