You need to sign in to do that
Don't have an account?
Nelson Davenapalli
Could not access attchment referred in cases using SOQL
First and foremost, i am a newbie with SF so pls bear with me and beg your pardon, if I dont use any adequate terms
Problem statement : Want to access files attached to Case objects using the SFDC rest api or by executing SOQL query.
The following is what i have tried so far but no sucess.
I am using a SF dev account. A workflow has been set to read email with invoices and convert into case with attachments.
However, when I ran a SOQL query from the dev console,
I dont see any attachments info. Moreover, I dont see any object called Attachment in ObjectManager. I also see that the attachments are visible under Files but dont see a way to use SOQL Query api to fetch those.
So, can anybody provide any info as to how to fetch attchments referred in cases programatically in Java.
Problem statement : Want to access files attached to Case objects using the SFDC rest api or by executing SOQL query.
The following is what i have tried so far but no sucess.
I am using a SF dev account. A workflow has been set to read email with invoices and convert into case with attachments.
However, when I ran a SOQL query from the dev console,
Select Id from Attachment
I dont see any attachments info. Moreover, I dont see any object called Attachment in ObjectManager. I also see that the attachments are visible under Files but dont see a way to use SOQL Query api to fetch those.
So, can anybody provide any info as to how to fetch attchments referred in cases programatically in Java.
Lightning:
In lightning when you upload attachments, it save as salesforce files. for querying salesforce files you need to understand three object:
- ContentVersion
- ContentDocumentLink
- ContentDocument
Refer this https://salesforce.stackexchange.com/questions/138860/how-to-query-a-file-uploaded-as-an-attachment-in-lightning-experienceClassic Attachments:
I hope you find the above solution helpful. If it does mark as best answer to help others too.
Thanks,
Ramesh D
All Answers
Lightning:
In lightning when you upload attachments, it save as salesforce files. for querying salesforce files you need to understand three object:
- ContentVersion
- ContentDocumentLink
- ContentDocument
Refer this https://salesforce.stackexchange.com/questions/138860/how-to-query-a-file-uploaded-as-an-attachment-in-lightning-experienceClassic Attachments:
I hope you find the above solution helpful. If it does mark as best answer to help others too.
Thanks,
Ramesh D
You can try this out
SELECT ContentDocumentId, LinkedEntityId FROM ContentDocumentLink where LinkedEntityId in ( SELECT Id FROM Case ) and LinkedEntity.Type='Case
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks and Regards,
Deepali Kulshrestha