Questions tagged [contentdocumentlink]

Use this object to query the locations where a file is shared or query which files are linked to a particular location.

Filter by
Sorted by
Tagged with
0
votes
1answer
47 views

Content objects not returned in queries run by public guest/site user

When associating a Salesforce File to an object in the UI, the associated ContentDocumentLink and ContentVersion records are not returned when a public guest/site user queries for them. An internal ...
2
votes
1answer
272 views

“Unable to create/update fields: VersionData” error when updating a ContentNote from Apex

I have some Apex code that inserts a ContentNote and the corresponding ContentDocumentLink. This works fine and the data can be viewed through the normal Salesforce UI. But some further code that ...
0
votes
1answer
289 views

How to import contentversion records(csv file) using dataloader

i have three records in csv file and three pdf files. how can i import these content version records to sandbox. i tried, but when i am uploading csv file using dataloader, i got Required fields are ...
7
votes
1answer
353 views

How to distinguish between ContentDocument and ContentNote?

There seems to be some unusual stuff going on with SObjectType for the enhanced note ContentNote (ERD) object and the underling ContentDocument (ERD) structure. For example, both these return a ...
1
vote
0answers
94 views

Translate IsPrivate check into Enhanced Notes

I am migrating notes into Enhanced Notes, How do I move the IsPrivate(Checkbox on Notes) values into Enhanced Notes? If the IsPrivate Checkbox is checked on Notes, how can I do this on EnhancedNotes?
4
votes
1answer
399 views

Generate a Public Accessible link from ContentDocument

My Client wants to upload Image files from Account and generate a link for this image file and save it in a custom field on Account. This link should be Public Accessible (access from outside without ...
4
votes
0answers
339 views

How can you insert a Salesforce File with Collaborator ShareType?

I am currently trying to insert a Salesforce File attached to a custom Invoice object with the Collaborator (C) permission, as described on the Salesforce Documentation. The code was originally set ...
5
votes
0answers
750 views

How to create an EmailMessage record with DML having HasAttachment to be 'true'?

I'm creating EmailMessage records via DML EmailMessage createWhatEmail = new EmailMessage( Subject = 'test' ,Status = '3' ,ToAddress = 'heim@...
4
votes
2answers
386 views

Why SingleEmailMessage.setFileAttachments() does not create visible attachments in the Activity Tab in Lightning Experience

I'm sending emails like this: Messaging.SingleEmailMessage m = new Messaging.SingleEmailMessage(); m.setToAddresses( new String[]{'heim@elastify.eu'} ); m.setSubject( 'test' ); m.setHtmlBody( ...
2
votes
2answers
658 views

ContentNote not inserting

I am trying to insert a new ContentNote and link it to an opportunity with ContentDocumentLink. However, after inserting the content note, the ID returns as NULL, so referencing it in the ...
0
votes
2answers
2k views

Error with ContentDocumentLink insert

I am receiving this error when I try to create a Note and inserting it to an opportunity. The opportunity is valid and there is no documentation of requiring the field, "document" for ...
2
votes
0answers
471 views

ContentDocumentLink - Can't set Visibility:InternalUsers when linking to case in specific sandbox

I have to push about 40,000 files into Salesforce as case files for a go live cutover. I have a process which creates a ContentVersion and then a ContentDocumentLink. In one sandbox, the files are ...
3
votes
2answers
1k views

SOQL ContentDocument: Ids not returning

A handful of our users have created notes on contact and opportunity objects that we are trying to port over. They are currently saved as ContentDocuments - but I also want to pull what objects the ...
0
votes
1answer
223 views

Query to retrieve certain files from Product2

I have the following use case: A web shop (Java) retrieving products from SF using the SOAP API. Attached "Files" are retrieved and displayed by selecting them through ContentDocumentLinks related to ...
1
vote
0answers
965 views

ContentVersion trigger event AfterInsert -> Insert ContentDocumentLink -> FIELD_INTEGRITY_EXCEPTION

We need to get a solution / workaround to insert in ContentDocumentLink several links when a File that has just been inserted (ContentVersion) and sibling records of other Custom Object. A third ...
-1
votes
1answer
198 views

Add a version of file to a existing file version(ContentVersion)

I am trying to attach a versions of file with content Versions to a existing content version, i don't know how to do that... actually i arrive to insert file but some duplicate file is present and i ...
0
votes
1answer
624 views

Scheduled Data Export: how to obtain ContentVersion linking data

I've used the Data Export feature to pull down ContentVersion data for Files and (Enhanced) Notes from a Salesforce org that's being migrated into a different org. I've been unable to locate the ...
0
votes
0answers
415 views

Convert legacy attachments into the files

I need help to convert legacy attachments to files with lastmodifieddate of file is equal to created date of attachments by using apex code. I need to do it for all objects on which attachments are ...
0
votes
1answer
425 views

File SOQL query

I need to search for Partner Accounts that don't have a Partner Agreement attached in the Files section. To find that, I believe the best way is to get a list of all Files attached to the Accounts ...
1
vote
0answers
213 views

How to show error msg in ContentNote?

I want to show error msg whenever notes get created without attaching to any records. As trigger on ContentNote is not available I've written Trigger on ContentDocumentLink, but I am not able to show ...
0
votes
1answer
237 views

Public guest user can't access ContentDocuments

I have a site with a Visualforce page that requires access to ContentDocuments linked to an Opportunity. My problem is that i can only see, as a public guest user, content documents that are uploaded ...
0
votes
0answers
447 views

Understanding ContentDocumentLink object API

As per documentation, I am trying to understand the following point - "For organizations with Communities enabled, a document can only be shared with users and groups that are a part of the community ...
0
votes
1answer
166 views

Prevent deletion of ContentNote

Is there anyway to prevent a user from deleting a New Note, based on the status of the Opportunity that the contentnote is linked to? The requirement is that I have a datetime field that is set, once ...
1
vote
2answers
1k views

How Content Document Should be Associated with Custom Object

I am trying to create File through ContentDocument . Once File is created want to associate with Custom Object Want to understand what is best way to associate File with Custom Object Use FeedItem ...
1
vote
0answers
427 views

Internal Salesforce.com Error while executing batch class

I want to create a batch class for the ContentdDocumentLink. I am getting records in the querylocator. But the execute() method is not working. In the debug logs also I am not able to trace any ...
0
votes
3answers
4k views

ContentDocumentLink insertion fails

I want to share all records with admin user using next trigger: trigger ContentVersionTrigger on ContentVersion (after insert) { system.debug('sdfsdf' + Trigger.new); for (ContentVersion ...
4
votes
1answer
672 views

How to prevent duplicate File (ContentDocument) if the same file is uploaded at multiple records?

This is a day-to-day use case: Assume there are many Opportunities on an Org. Now Sales-Reps are uploading some auxiliary information as Files in Lightning using the standard related list and there ...
0
votes
0answers
183 views

How do I share files wtih a chatter group automatically via a trigger?

When I upload a file via the chatter feed I want that the file is shared with a particular group in my org with contributor status. I think it must be a trigger on the ContentDocumentLink and a after ...
1
vote
2answers
1k views

LinkedEntityid is the user incorrectly coming in ContentDocumentLink trigger

I am creating a trigger on ContentDocumentLink and I am attaching a file via upload file option in related list to a record. In trigger(after insert), the linkEntityId is generated as user id but I ...
0
votes
0answers
212 views

Why ContentDocumentLink reference user?

I need to add copy of Service Report when it is created in Service Appointment to its parent. To do so I tried to create trigger on ContentDocumentLink. My idea was to get this ContentDocumentLink, ...
4
votes
0answers
472 views

USING SCOPE Everything not working

I wrote a trigger on ContentDocumentlink to get a count of number of files uploaded against Service_Request__c (Custom Object) record.It works fine for new files are uploaded on Service Request record....
0
votes
1answer
139 views

Batch Apex creating Multiple contentdocumentlinks when trying to “convert” tasks to notes…

I am trying to look at all tasks for a specific time frame, then create a note and set the LinkedEntityId to the whatid or whoid. This code creates the content note, 1 for each task. But then created ...
1
vote
0answers
370 views

Cannot Query ContentDocumentLink as a Portal user

I have a situation where I am trying to retrieve documents which were generated by DrawLoop and added to SFDC as Files. As the System Admin user, I can query for this data using the following query: ...
0
votes
0answers
273 views

How to use current record Id (In after insert trigger) to save it in some different object?

Please find my scenario below I will talk in generic words so that the objects name should not confuse someone. I have written after insert trigger on an object and obviously, I am getting the Id of ...
6
votes
0answers
2k views

ContentDocumentLink Apex after insert trigger error

Edit: I've built an after insert trigger on ContentDocumentLink. On cropredy's direction, I've bulkified my code and I think improved it generally. It "works" in that it accomplishes my business ...
0
votes
1answer
140 views

Data load to ContentNote Object using any tool (Informatica Cloud or DataLoader)

I found the below link (another question) - this does not seem to be a correct answer and am urgently looking for a solution for the same. ContentNote with related Object After loading the ...
1
vote
1answer
390 views

Retrieve ParentID on insert of file

How to retrieve AccountId on insert of file. system.debug('LinkedEntityId $$$$'+LinkedEntityId) always gives OwnerId. But after insert of file, I can retrieve two rows from below query on ...
2
votes
2answers
97 views

how to select a ContentDocumentLink via SOAP API from .NET?

We are having trouble getting a "ContentDocumentLink" object back to a .net client via an authenticated API call. A similar call works fine for records from the "Attachment" object. The credentials ...
4
votes
5answers
2k views

Document: You don't have permission to share this file

I am trying to upload a file from salesforce sites into Files and then relate it with a record using VF page. i am able to upload the file and while creating a ContentDocumentLink i am getting this ...
0
votes
1answer
138 views

ContentNote Load using Informatica Cloud

Background : We have lot of junk data from source for Lead object and the same is suggested to be concatenated and loaded to Notes. Issue: We could load the Title and Content - For Titel - A ...
0
votes
1answer
343 views

Insert ContentDocumentLinks for Chatter Content Posts

We have a set of ContentVersion records that have been inserted by users via a FeedItem post. Unfortunately because Chatter groups has many functional limitations we have to migrate these files to ...
31
votes
7answers
11k views

Obtaining all ContentDocument records using SOQL

According to the Salesforce documentation on ContentDocument Users (including users with the “View All Data” permission) can only query files they have access I find this very strange. Why would a ...