0

I have Added Notes & Attachment in Related List , So when I upload any svg image , It get stored as a file instead of Attachment . So How can we store that image in Attachment instead of contenVersion . My Actually issue is , If file get stored as contentVersion and if other user tries to fetch that file using sql query , Its not returning that record , I tried with adding allUsers to contentDocumnetLink , But still it is not working , So I decided to go with Attachment , As Attachment is accessible to all users . Can you please tell me , How to store image which is uploaded on Added Notes & Attachment button as a attachment

2 Answers 2

0

Not sure if I get the question right, but here are some advices.

In general the data model of Files in SF is a bit more complicated than it seems. To get the latest version of a document you should always go trough ContentDocument object to get the latest version using "LatestPublishedVersionId: field, please see the data model and specifications of ContentDocument:

https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_erd_content.htm https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_contentdocument.htm

Salesforce switched to files instead of attachments an year ago. And it is their intention that users use files for storing documents instead of attachments. I would not go against that since all new capabilities would be coming for files and not attachment objects. Also when using SF standard objects it is always good to go with them (their logic and capabilities) this will usually make your life easier in the future.

8
0

In salesforce lightning, the documents will always upload under salesforce files only.

If you want to upload those files in attachments, you can create a custom component to upload the files and store them under the attachments.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .