There are quite a few ways content (files) are stored in Salesforce. This article shows you ways to access them through a SOQL query.
EMAIL ATTACHMENT:
Let's consider the scenario where we have attachments against email messages related to a Case. Let's see how to query it in SOQL.
SOQL Query:
Assuming case number 123
ATTACHMENTS against a Case:
Salesforce Files Attached to a Case Feed:
EMAIL ATTACHMENT:
Let's consider the scenario where we have attachments against email messages related to a Case. Let's see how to query it in SOQL.
SOQL Query:
Assuming case number 123
Case cs = [Select Id from Case where CaseNumber=123];
Map<Id,EmailMessage> caseEmails = new Map<Id,EmailMessage>([Select Id from EmailMessage where ParentId=:cs.Id and HasAttachment = true]);
Set<Id> caseRelatedIds = new Set<Id>();
if(caseEmails != null){
caseRelatedIds.addAll(caseEmails.keySet());
}
List<Attachment> AttachedFiles = [SELECT Id, Name, Body, ContentType FROM Attachment WHERE ParentId IN :caseRelatedIds];
ATTACHMENTS against a Case:
Case cs = [Select Id from Case where CaseNumber=123];
List<Attachment> AttachedFiles = [SELECT Id, Name, Body, ContentType FROM Attachment WHERE ParentId IN =:cs.Id];
Salesforce Files Attached to a Case Feed:
Case cs = [Select Id from Case where CaseNumber=123];
List<CaseFeed> caseChatterFiles = [SELECT Id, Type, Body, Title, LinkUrl, ContentData, ContentSize, ContentFileName, ContentType From CaseFeed where Type = 'ContentPost' and parentId = :cs.Id];
Delegated authentication
Your company's authentication service is currently down. Please contact the administrator at your company for more information.
10:44 AM
When your delegated authentication fails, you are presented with the error message as in this article title. Below are a few steps to troubleshoot when you face such a issue.
Do you whitelist Salesforce IP's access to your internal server? If yes, check this page to make sure no new IP's were added to the list.
Check the Delegated Authentication Error section under setup.
If you see an error message as below, make sure the certificates are updated on your internal server. Here is an article with more details and list of certificates approved by Salesforce - Click here
javax.net.ssl.SSLPeerUnverifiedException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Do you whitelist Salesforce IP's access to your internal server? If yes, check this page to make sure no new IP's were added to the list.
Check the Delegated Authentication Error section under setup.
If you see an error message as below, make sure the certificates are updated on your internal server. Here is an article with more details and list of certificates approved by Salesforce - Click here
javax.net.ssl.SSLPeerUnverifiedException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target