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
2 answers
613 views

How can I mark a contentDocument or ContentDocumentLink?

I made a lightning web component to set if a content document it is approve or reject but I cant create any field in this objects... There is a way to mark if a Content document was approve or reject ...
Tomas Garcia Etchegaray's user avatar
1 vote
1 answer
319 views

CreatedById Doesnt Work

I am currently developing an external application that uses the Salesforce REST API to consume. The POST method to the endpoints /services/data/v47.0/sobjects/ContentNote&& /services/data/...
CodyB1150's user avatar
2 votes
0 answers
51 views

SOQL Querry Error for ContentDocumentLink [duplicate]

Error: Implementation restriction: Implementation restriction: ContentDocumentLink requires a filter by a single Id on ContentDocumentId or LinkedEntityId using the equals operator or multiple ...
Venkat Vamshi's user avatar
0 votes
1 answer
602 views

Issue with Displaying Images using ContentDocumentLink

I am having trouble displaying images using Content Document Link in my aura component. I had used these links for reference: https://developer.salesforce.com/blogs/engineering/2014/04/building-...
Lex007's user avatar
  • 1
2 votes
1 answer
393 views

Why Blob equals doesn't work if one of the Blobs is retrieved from ContentDocument?

In brief, I can't test the value stored in a ContentDocument. Even if the value of the two Blobs is the exact same, equals would return false. Do someone know the reason? Here's a unit test to check ...
Francesco Pitzalis's user avatar
2 votes
0 answers
132 views

Email sent when inserting ContentDocumentLink record

I have noticed that when using Apex to programmatically insert a list of ContentDocumentLink records that the users specified in the LinkedEntityId are receiving an email notifying them that the ...
Sean Russell's user avatar
3 votes
0 answers
300 views

How to determine if the user has enough permissions to Share ContentDocument to sObject

I have a situation that seems to be consistent with the top comments here: https://success.salesforce.com/ideaview?id=087300000006n4GAAQ Specifically, i have a Content Workspace aka Content Library, ...
zaitsman's user avatar
  • 1,890
3 votes
0 answers
398 views

SOQL query in Trigger returns no results but returns a row in Developer Console

I have the following code snippet in a Helper class that's being called by an After Insert trigger (modified to demonstrate my objective): Set<Id> reuseIds = new Set<Id>(); reuseIds.add('...
mchandler's user avatar
  • 130
1 vote
1 answer
254 views

Find all notes which are not related to anything

We imported numerous notes into Salesforce and we were able to connect most of them to their corresponding objects with ContentDocumentLink. However, a few of need to be manually connected. So how can ...
adius's user avatar
  • 159
2 votes
1 answer
50 views

Perplexing ContentDocumentLink SOQL issue

I have the following code: // Note: cdlToDos == Map<Id, Set<decimal>> System.debug(cdlToDos); List<ContentDocumentLink> cdlList = [ SELECT Id, ContentDocumentId, LinkedEntityId ...
Ixalmida's user avatar
  • 311
-1 votes
1 answer
193 views

How to delete uploaded files from community attachements

I am uploading pdf into the attachement from community. So after uploading the pdf. Pdf will create a case into the salesforce org. So i want that after creating the case in custom object called audit ...
Pratyanch Rajput's user avatar
3 votes
0 answers
428 views

While adding new contentDocumentLink Contentdocuments lastmodifieddate is getting changed. How we can stop that

I am migrating attachment records to contentVersion. I am also updating created and lastmodified date of new contentversion records from Attachment record. It is getting updated fine. But when I am ...
Manjot Singh's user avatar
  • 3,406
2 votes
0 answers
1k views

Site Guest Users Cannot Insert or Query ContentDocument or ContentDocumentLink objects

Update (31/01/20) As per the newly created Knowledge Article, Salesforce has stated that in order to not receive an error while Inserting/Querying a ContentNote/ContentDocument/ContentDocumentLink as ...
TSmith's user avatar
  • 4,932
0 votes
0 answers
166 views

ContentDocumentLink trigger context variable trigger.new is not returning correct value in Classic

I am having a trigger on ContentDocumentLink object. The user upload a file from UI in classic on Opportunity object record. Ideally when he does that, The trigger.new should return two value, one ...
sanket kumar's user avatar
0 votes
0 answers
197 views

Added ContentDocumentLink to Library but Library Members Can't See Record

So I have a ContentVersion that gets added to a record, then I create a ContentDocumentLink record connecting that File to the Library. That Library includes community users. How come they can't see ...
Peter Luo's user avatar
  • 140
0 votes
0 answers
2k views

Visualforce page rendered as PDF saving to salesforce files (Content document) but failed to reload error on opening pdf

Rendering VF page as PDF. Attachment pdf is working fine in classic. On opening pdf in classic view PDF is correctly opening but when i switch to lightning then on click of button pdf is saved in ...
Maik Floyd's user avatar
1 vote
1 answer
3k views

ContentDocumentLink fires trigger multiple times on list insertion [duplicate]

We have a trigger on Order attachment insertion, so that a field is populated with a link to the attached documents whenever a user uploads one or multiple files to an existing Order. We created the ...
sissy's user avatar
  • 113
0 votes
1 answer
726 views

How to add a filter in query to only fetch specific files

I am running a SOQL query on contentversion to fetch files that are attached to opportunity. However, I am noticing that it is even pulling the notes attached to the opportunity as well. Is there a ...
Anonymous's user avatar
0 votes
2 answers
2k views

How to copy LinkedEntityId/Opportuntiy id in Content version object via Apex trigger

I have created a custom field(lookup field to opportunity) on Content version object that would denote the opportunity id that file is connected to. The custom field is Opportunity__c. Here is the ...
Anonymous's user avatar
0 votes
1 answer
2k views

How do I display Opportunity ID/LinkedEntityID in content version object

I am running a query on contentversion to fetch files related to opportunity from Salesforce. However the content version records returned from the query does not tell me what opportunity id is that ...
Anonymous's user avatar
0 votes
1 answer
2k views

How to create a nested query that fetches opportunities, Content Document and Content Version [duplicate]

I am trying to fetch all files that are associated with the opportunities in 'XYZ' stage. I am trying to construct one nested query that would first fetch all the opportunities in that stage, then ...
Anonymous's user avatar
0 votes
2 answers
2k views

Error while inserting contentdocumentlink with Collaborator access through Apex

I have a lightning component which executes an apex class on load. In apex class, I'm getting some list of files and providing 'Collaborator' access to the logged-in user if he is eligible. When I'm ...
Sunil Reddy's user avatar
0 votes
1 answer
262 views

Linking ContentDocuments to Products

I am looking to associate ContentDocuments to Product2 records based on values in the ContentVersion record. For example I am uploading a new File record in Salesforce that is a document about ...
Jeff's user avatar
  • 5
3 votes
3 answers
6k views

Unable to delete ContentDocumentLink

This is all on a Salesforce Community. I have a situation where a user is uploading a file and it's temporarily assigned to their user record. Once they submit the form and it creates a custom object ...
Tony Evans's user avatar
0 votes
0 answers
183 views

Error while inserting a new revision of a file programatically

I am trying to upload a new revision of a file in ContentVersion object programmatically by Apex. I am getting the below error while inserting a new record of ContentVersion. 15:21:52:424 ...
nica's user avatar
  • 1,350
0 votes
1 answer
144 views

Documents in Salesforce Customer portal behind login

We have a Customer portal that our member log into. Once they log in they have access to a documents library which are are held in the Static Resources section. I have a document that we will want ...
jesstp's user avatar
  • 13
1 vote
1 answer
7k views

Deleting 'Files' in Lightning Experience

As per Salesforce documentation 'Files' (ContentDocument) can be deleted only by the user who created them. In order to provide access to delete a file created by other users, Salesforce recommends ...
maniac coder's user avatar
1 vote
1 answer
755 views

How to create a new contentversion(pdf) using the existing contentversion(word) version data

I want to generate the pdf file using word document. I was trying to create the new contentversion(pdf) using the existing contentversion(word) versiondata. However, the pdf is not opening after ...
bhaskar b's user avatar
5 votes
2 answers
5k views

ContentVersion FileExtension

Does anyone know how I can change the FileExtension for a new ContentVersion in a test class? Im currently trying to create a test class for my ContentDocumentLink Trigger, in which I have an if ...
Tim Werner's user avatar
1 vote
1 answer
2k views

How to generate an external downloadlink for files

I have created a visualforce page (site) with a dowloadlink from files. I can use this when I am logged in into Salesforce. I want to achieve this for external users by a site. In salesforce It is ...
Thomas's user avatar
  • 2,294
4 votes
1 answer
6k views

How to query ContentDocument and Custom object's fields at once?

We have 3 objects. OS_Account_Document__c (Custom) ContentDocument ContentDocumentLink I need to query two custom fields (Document_Type__c and Custom_Document_Description__c) from the Custom Object ...
Prakhar Saxena's user avatar
1 vote
1 answer
1k views

How to upload multiple files to ContentDocumentLink Object in one call from a lightning component?

I want to upload multiple files from a public site to salesforce ContentDocumentLink. How I can create bulk of files on javascript (client) side and handle them from apex? Lightning Component: ...
Alex Andreadis's user avatar
6 votes
3 answers
16k views

How to generate a download URL for a ContentDocument in Lightning Community

We're querying ContentDocumentLink for a list of documents related to a specific object record that the user has access to, and attempting to create a link for the community user to download that ...
Jerbot's user avatar
  • 161
2 votes
2 answers
3k views

Move a ContentDocument from one library to another in Apex

Is there a direct way to do this in Apex? I tried doing DML to ContentDocumentLink or ContentWorkspaceDoc. But nothing works. What I tried so far Update the Library in ContentWorkspaceDoc ...
k Walker's user avatar
1 vote
0 answers
471 views

How to bulk query ContentDocumentLink for Scheduled Job

I have a trigger that fires on the ContentDocumentLink object that then calls a REST Webservice. The logic basically places a users document into our Document Management System from Salesforce and ...
David Leckenby's user avatar
1 vote
1 answer
3k views

System.QueryException: Implementation restriction: ContentDocumentLink requires a filter by a single... in test class?

I'm facing System.QueryException: Implementation restriction: ContentDocumentLink requires a filter by a single Id on ContentDocumentId or LinkedEntityId using the equals operator or multiple Id's ...
uma451's user avatar
  • 799
0 votes
1 answer
4k views

how can i query all attachments related to a case?

I need to be able to query for all attachments related to a single case, even the attachments related to emails on the case. I also need it this code to get all attachments if there are multiple ...
Logie C's user avatar
  • 123
1 vote
0 answers
620 views

INVALID STATUS on ContentVersion create from Attachment [duplicate]

I'm currently trying to create ContentVersion records from Attachment ones but it's giving me the following error: INVALID_STATUS, Documents in a user's private library must always be owned by that ...
molinet's user avatar
  • 867
1 vote
0 answers
774 views

Not able to create ContentDocumentLink FIELD_INTEGRITY_EXCEPTION

Trying to create a Content Document Link linking a text file to a custom object (an error log object). But keep getting the following error: First error: Insert failed. First exception on row 0; ...
Shuaib Ahmed's user avatar
0 votes
1 answer
761 views

Attachment downloaded as type file

I have below code to add content document versionData into standard attachment. Map<Id, Blob> bodyContent = new Map<Id, Blob>(); List<ContentVersion> contentDocs = [SELECT ...
JURY's user avatar
  • 183
0 votes
1 answer
914 views

Attach Files to a Big Object record

I would like to associate Files with Big Object records. Documentation inference implies this is not technically possible... if a Big Object could be a "LinkedEntityId" I imagine it would have been ...
krigi's user avatar
  • 2,191
0 votes
0 answers
36 views

Trying to determine the best way to write a trigger on a file(ContentDocument) which is uploaded and Is realted via COntntDocumentLink to a Case

I am very new to Apex (I wrote one two line trigger and test class successfully) and am trying to figure out this scenario. When a customer or internal user uploads a file related to a Case I need an ...
Brett Freeburg's user avatar
0 votes
0 answers
2k views

Add Upload File button to a custom object

I am working on an assignment where I built a custom object on top of files (ContentVersion, ContentDocumentLink, ContentDocument). Since the customizability of files is limited in Salesforce, we are ...
Balaji Pooruli's user avatar
2 votes
1 answer
3k views

ContentDocumentLink filter not working- Trailhead Conference Management App

Im facing below error: Implementation restriction: ContentDocumentLink requires a filter by a single Id on ContentDocumentId or LinkedEntityId using the equals operator or multiple Id's using the IN ...
Priya's user avatar
  • 115
0 votes
1 answer
1k views

Could not able to retrieve VersionData from Content Version after insert of ContentDocument

I am trying to retrieve the body of ContentDocument after insert. Below is my code.My trigger is on ContentDocument (After Insert) public static void syncContentDocument(List<ContentDocument> ...
JURY's user avatar
  • 183
0 votes
1 answer
455 views

content deliveries and public links missing in npsp org

I have created a trigger on contentDocumentLink in my developer org and generating public url for file sharing using ContentDistribution object and when i started moving code to npsp org sandbox, ...
Suraj's user avatar
  • 11
0 votes
1 answer
593 views

Link files lead to new custom object

On Lead conversion I also create a new object to which I map several fields of the lead trough processbuilder. I also want to pass the files from the lead to the new custom object. I am trying to do a ...
Thomas's user avatar
  • 2,294
0 votes
1 answer
2k views

APEX - Get ContentDocumentLink when deleting file (with ContentDocument)

I have an object 'ClientContract__c' with affiliated files. When adding a file, this changes a technical checkbox field on the parent object. I would like to override this technical field if there are ...
cpt_3n0x's user avatar
8 votes
1 answer
647 views

Weird Behaviour of Bulk ContentDocumentLinkTrigger in Test Context

I know that ContentDocumentLink triggers are not bulkified by Salesforce. I was expecting that behavior and was writing test classes accordingly. It looks like, ContentDocumentLinkTrigger doesn't ...
Pranay Jaiswal's user avatar
3 votes
3 answers
7k views

Community user cannot download file

I am using an old portal for my customers, with customer community user licenses. In the portal, my users should upload files and then download the files that they have uploaded. The portal is ...
Itai Shmida's user avatar
  • 4,995