19626
2023-07-17 254ea442ff0e0a7a97e9f481e9f127a782cba840
force-app/main/default/classes/ConsumTrialPDFController.cls
@@ -224,10 +224,11 @@
    }
    public static string GetImageBase64(string id){
        List<Attachment> atts = [SELECT Id, IsDeleted, ParentId, Name, IsPrivate, ContentType, BodyLength, Body, OwnerId, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp, Description FROM Attachment where id=:id];
        if (atts.size()==0) {
        List<ContentVersion> version = [select VersionData from ContentVersion where ContentDocumentId =: id];
        // List<Attachment> atts = [SELECT Id, IsDeleted, ParentId, Name, IsPrivate, ContentType, BodyLength, Body, OwnerId, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp, Description FROM Attachment where id=:id];
        if (version.size()==0) {
            return null;
        }
        return 'data:image/png;base64,' + EncodingUtil.base64Encode(atts[0].body);
        return 'data:image/png;base64,' + EncodingUtil.base64Encode(version[0].VersionData);
    }
}