Skip to main content

Questions tagged [contentdocument]

Use this object to retrieve, query, update, and delete the latest version of a document, but not a content pack, in a library or a file in Chatter.

Filter by
Sorted by
Tagged with
0 votes
0 answers
20 views

UNABLE_TO_LOCK_ROW on ContentFolder when attempting to create ContentDocument

Recently the primary admin user of a production org has intermittently different types of jobs and batches failing with the following error: "First error: Insert failed. First exception on row 0;...
Felix van Hove's user avatar
3 votes
1 answer
47 views

Using Multi-Part API Create Document in Salesforce Given Max File Size Error

I am trying to upload file to my Salesforce Instance using REST API documented here: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_sobject_insert_update_blob.htm ...
Jessica Sun's user avatar
1 vote
0 answers
48 views

Possible reason for inserting a ContentVersion causing a row lock error on ContentFolder?

I've got some code to insert a ContentVersion in a Queueable so that it can be read later by another Queueable or a Platform Event once all the files are prepared. The insertion is nothing fancy: ...
Aidan's user avatar
  • 13.8k
0 votes
1 answer
35 views

Read PDF from stripe portal

I am having this URL https://pay.stripe.com/invoice/acct_1OtiZXH7y1vTRsp1/test_YWNjdF8xT3RpWlhIN3kxdlRSc3AxLF9RMkxNanIzNXN3TTlZOHNaaUZLZm9kQnBjemh3STBXLDEwNTI2NDAzOA0200luNre0xP/pdf?s=ap and when we ...
SFDC-Beginner's user avatar
3 votes
1 answer
49 views

Store Lightning Dashboard as PNG in Files

The use case here is that I need to fetch the image/png of Lightning Dashboard and store it in Files via Apex So first, I try to do a callout to Dashboards REST API - Http http = new Http(); ...
Aditya M's user avatar
  • 420
1 vote
1 answer
94 views

Within Governor Limits: Split a Large Text File Apart In Apex

I am writing a class that splits text file apart. Chunking them into 5000 line groupings so I can upload the files contents to another limited system. The text file contains a Json object on each line....
Ryan Sherry's user avatar
0 votes
0 answers
14 views

Capture EXIF Data in Salesforce and Delete [duplicate]

IS there a way to capture data on image(EXIF data) while an user tries to upload a image file into chatter and delete the data on the image file?
Niteesh bharadwaj's user avatar
0 votes
1 answer
119 views

Accessing ContentVersion file data from Lightning web component

We are trying to build a zip download feature for documents. The zip can contain files stored in ContentVersions and external files. It works fine for external files. But due to CORS, we cannot access ...
Andreas Tschritter's user avatar
0 votes
1 answer
43 views

Can visibility of Files related to sObject be restricted for certain users that have edit access to that object

We have Internal Financial Request object and Files related list. Let's assume there is two users user1 and user2 with edit access to a particular record of IFR. If user1 uploads file related to this ...
dobra_wodka's user avatar
0 votes
0 answers
38 views

Send multiple Content Document in a rest api in salesforce [duplicate]

I am sending related attachments from an email message to an external api but the files arrive damaged. I have tried with other files from other sources but it doesn't work in salesforce. Here is the ...
Felipe Peña's user avatar
0 votes
0 answers
173 views

SOQL nested query ContentVersion, ContentDocument, ContentDocumentLink

I am trying to access ContentVersion, ContentDocument, ContentDocumentLink to achieve a count of each contentversion per object. The relationships between the objects I activated QueryAll Document, ...
Art's user avatar
  • 11
0 votes
1 answer
264 views

See what objects ContentDocument is linked to and get the count per objects

To keep it simple, I want to know to which Objects are linked my Attachments, so I executed the following SOQL query : select count(id), Parent.type counter from Attachment group by Parent.type I ...
Art's user avatar
  • 11
1 vote
1 answer
228 views

Uploading a Content Version record using Postman with OwnerId field throws error

I have created a connected app which my client will be using to create cases in Salesforce. On testing the connected app using Postman I was able to get the access token, and also responses for SOQL ...
sumchans's user avatar
  • 789
1 vote
1 answer
64 views

Error id value of incorrect type when inserting ContentDocumentLink

I know from the error that it is looking for the id of the contentdocument and not the id of the contentversion that got inserted. But I am just confused after inserting the files how do I get the id ...
sumchans's user avatar
  • 789
1 vote
0 answers
197 views

ContentDocumentId is null when guest user is uploading a file in Salesforce site

So I have a web-to-case scenario. I need to build a customer support form wherein the customer is able to fill out name, email, subject, description and attach files. Once he fills all the fields and ...
Neha Nigam's user avatar
0 votes
2 answers
629 views

Not getting any records from ContentVersion in Salesforce SOQ query which we are not owner of

When I am creating a new record (release), I would like to get a file off a related record (inventory) and then create a copy of it on the release. The problem I am facing, is that this only works if ...
Finbar Tracey's user avatar
0 votes
0 answers
44 views

get all stand alone FILES

I have a process of case auto deletion, and it seems that when a case is deleted and a file was attached to it, the file is not deleted in the same time. Q1: Is it possible that files remains in SF ...
Raphael D's user avatar
  • 616
2 votes
1 answer
618 views

Create ContentDocumentLink after insert ContentDocument error

I have pretty simple requirement but I am facing error and I can't understand what is going wrong. I need to add ContentDocumentLink to add file to CollaborationGroup after insert with C permission. I ...
Maciej's user avatar
  • 45
-1 votes
1 answer
131 views

How to fetch file properties from Content document object using API

I am trying to get all the files attached to a case. I have found a way to download the files attached to case using sfc/servlet.shepherd/document/download/${contentDocumentIdLink}?operationContext=S1 ...
Jakka rohith's user avatar
3 votes
0 answers
87 views

Mismatched LInkedEntityId on ContentDocumentLinks

I'm trying to link attachment files to Salesforce EmailMessages. Steps so far: Upload attachment file by posting to /services/data/v58.0/sobjects/ContentVersion. Query ContentVersion table to get ...
Alex's user avatar
  • 31
0 votes
0 answers
89 views

INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, You don't have permission to share this file.: [ContentDocumentId]

I am Facing this issue only while executing the below code in the Guest User context, how to resolve it? The exeption occurs while inserting contentDocumentLink Record. ContentVersion cv = new ...
Satyendra Raghuvanshi's user avatar
0 votes
1 answer
2k views

How to identify content documents related to a specific type of custom object

I have scenario where in I need to extract content documents related to specific object (Tried to this via SOQL like 2 step query) SOQL for Id's of all the content documents in the org. SOQL on ...
Smita Hodiggeri's user avatar
0 votes
1 answer
212 views

Guest User cannot edit ContentDocument

We have a system in place to allow guest users (under some circumstances) to modify files in Salesforce (those pesky ContentDocument and ContentVersion records). This system works in the development ...
AvailableName's user avatar
0 votes
1 answer
533 views

Proper way to store a .pdf from a REST callout using ContentVersion/ContentDocument

I am working on an integration where I am provided a URL + document ID, which should send back a .pdf, I retrieve it using a GET, and then I take the blob of the pdf and create a ContentDocument and ...
Chris's user avatar
  • 61
0 votes
1 answer
52 views

Does Test.setCreatedDate work on ContentDocument?

I wrote a trigger that checks if a contentdocument is greater than 10 minutes old, then throws an error to stop it from being deleted. This is to allow users to delete the file if they accidently ...
Dan Wooding's user avatar
  • 3,611
4 votes
1 answer
328 views

How can I prevent a ContentDocument being deleted when it is linked to a record meeting certain criteria?

I have ContentDocuments being used to capture "proof" against certifications. Once the submitted certification (and "proof") has been reviewed, that certification is marked "...
Phil W's user avatar
  • 37k
0 votes
2 answers
721 views

What is the order of execution in content related objects?

I have a scenario to insert the content document link for sharing the contentdocument with contentworkspace (library) when the contentdocument is created. I want to write a trigger to achieve this. I ...
riseAJdev's user avatar
0 votes
0 answers
66 views

Documents access to limited group of users (related to Account)

I have a requirement There are a group of users who can upload documents on Account (possibly public group) However, the documents uploaded should only be accessible to that group of users and not ...
SEuser's user avatar
  • 1,847
0 votes
1 answer
98 views

Can we retrieve ContentDocuments aka Files using ANT migration tool in Salesforce? [duplicate]

I have been trying to retrieve ContentDocuments/Files using the following package.xml in ANT <?xml version="1.0" encoding="UTF-8"?> <Package xmlns="http://soap....
Cathy's user avatar
  • 73
0 votes
1 answer
402 views

Is there a way to find Dimensions (Height and Width) for a Content Document

Is there a way to find Dimensions (Height and Width) for a Content Document uploaded on a custom object? The Content Document could be JPG, PNG or GIF The use case is: When users upload a content ...
Moe Najim's user avatar
1 vote
1 answer
1k views

Another ContentDocumentLink, ContentVersion & ContentDistribution Question

I apologize if this has already been covered (It probably has, I just cant find it in the 'Open your eyes' section of the forum) But I'm having troubles creating a list of publicly accessible URLS ...
Mike Cuming's user avatar
0 votes
1 answer
955 views

Content Document Parent ID Salesforce

I am completely lost on how to populate a ParentID for Content Documents. I would like to find the parent record (custom object record) linked to the Content Document. I have easily sorted it in the ...
Victoria Aroworade's user avatar
1 vote
0 answers
366 views

INVALID_CROSS_REFERENCE_KEY, invalid cross reference id: [] ContentVersion

Hello I am having problems to create a ContentDocument with Apex code. I am trying to create those records from a partner user community that has some permission set. I get the next error when trying ...
TechGuy's user avatar
  • 117
0 votes
2 answers
104 views

Query for Related Attachments works in query editor but not Apex

I am trying to make a simple APEX Class that returns a records related attachments. When I do the following SOQL query in the Query Editor I get the 3 expected results: SELECT Id FROM ...
Austin Kelly's user avatar
0 votes
1 answer
2k views

SOQL Query for to fetch Content Version documents of Parent to do data update activity?

We have a requirement where when we close the work order, we have to set custom field value "Allow Archieving" to true on it's content versions documents. For this, I have already written a ...
SFDCDJ's user avatar
  • 1,904
1 vote
2 answers
2k views

How to create a public link for library in files?

I Have a library let's say "XYZ Library" in Libraries Section of files and I need to get a public link for that library same as we create for Folders from the drop down, so that I can use it ...
Rehan Charles's user avatar
2 votes
1 answer
190 views

Help with sorting content documents by custom field on its LinkedEntity

This SOQL statement works, but I'm trying to sort the Content Documents by a field e.g. Sort_Order__c on Invoice__c. SELECT ContentDocument.id,LinkedEntity.Name,LinkedEntityId FROM ContentDocumentLink ...
Dan Hardy's user avatar
0 votes
1 answer
62 views

Share LinkedEntityId with grandchild

I am trying to share a file with a grandchild record. Parent: Account: Child of Account: Contact Child of Contact: Invoice if(Trigger.isInsert){ Set<Id> getAccts = new Set<Id>(); ...
Phuc's user avatar
  • 373
0 votes
0 answers
270 views

ContentVersion records created in test not returned by query in execution

I'm trying to test an apex class where I send an email. In said email, I add attachments where I have to use queries to find the contentversions and creating attachments based on those, for instance: ...
joacoiudica's user avatar
1 vote
2 answers
3k views

Adding custom field to Files upload in salesforce

We have a custom object where we are allowing users to load files. Now, we need to provide user a check box before uploading this files into Salesforce so that we can revisit those files for data ...
LWC_Beginner's user avatar
1 vote
2 answers
2k views

Is it possible to find ContentDocument and attach that file to a FeedItem through a flow?

I am trying to create a feeditem and trying to find a documentcontent file and attaching it to this feeditem through a flow. I think I can find the version of the contentdocument by looking at the ...
Hulk Buster's user avatar
0 votes
1 answer
2k views

SOQL Query for ContentDocument

I ran this query below select id, owner.name, ownerid, title from contentdocument where id = '0695i000007L0FIAA0' I got this results which shows me the owner id I then ran another query trying to ...
Hulk Buster's user avatar
2 votes
1 answer
1k views

What controls ContentVersion access in non-sharing apex class?

I recently wrote an apex class which queries the ContentVersion records for a lead and embeds them in a PDF page. The class is not running with Sharing, so system access, and everything is working in ...
Tezyn's user avatar
  • 346
1 vote
0 answers
353 views

Display folders for an object according to a picklist value using lwc

Hi all I have an object name FS where I have uploaded various files in each records. Also in the content version record I have a picklist value named Category which has certain picklist values New and ...
user121495's user avatar
1 vote
1 answer
4k views

How to give Community Portal user access to view ContentDocument

I have a Lightning Web Component, its job is to return all the documents related to a record. I have tested the web component by running it internally and it looks like it is performing as expected. ...
Simple Code's user avatar
0 votes
1 answer
278 views

Displaying Related Documents OF A Custom Object in VisualForce Page Salesforce

Good day everyone, I am in a little bit of a pickle and could really your use help. So I am trying to make a visual force page that displays all the related documents to a custom object. I am ...
Simple Code's user avatar
0 votes
0 answers
776 views

DLRS: How to count all Files (without Notes) related to an Opportunity?

I created a DLRS (Declarative Lookup Roll-up Summary) on the Opportunity that counts how many Files are related to it. However, the count gives me both the Files+Notes and I only want the File count, ...
Lut's user avatar
  • 287
-1 votes
1 answer
467 views

I want to write trigger to automatically upload files in bulk on Account object file related list. Please help [closed]

trigger ContentVersionTrigger on ContentVersion (after insert) { //SELECT ContentDocumentId FROM ContentVersion where Id=:trigger.new[0].Id; ContentDocumentLink docLink = new ContentDocumentLink();...
Rakhi Khairnar's user avatar
0 votes
1 answer
315 views

Query files from private folders by SOQL to wipe content?

My QA users have overfloaded the Developer Sandbox with 234 MB of files. I try to wipe all the content, however, looks like SOQL query doesn't return all the files even though I can see them in UI. I ...
Patlatus's user avatar
  • 17.3k
2 votes
1 answer
2k views

LWC Content Document preview is not working

I'm having issues with opening a Content Document preview in my LWC component. Here is my code: HTML: <template> <template if:true={files}> <ul> <template ...
user569925's user avatar
  • 1,179

1
2 3 4 5
8