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.
368 questions
0 votes
1 answer
53 views
Insert of ContentDocumentLink Silently Fails Even When Insert of ContentNote Succeeds
I've tested this many times, and in batch, and found that perhaps 10-20% of the time, the creation of the ContentDocumentLink silently fails, even when the insert of ContentNote succeeds. No errors ...
-1 votes
2 answers
70 views
Content Version Insert Error
System.DmlException: Insert failed. First exception on row 0; first error: INVALID_STATUS, Documents in a user's private library must always be owned by that user.: [OwnerId] Below is the Code block ...
1 vote
1 answer
53 views
How does image on Summary Card is linked?
I have standard Summary Card component on a custom object. When you upload image it gets attached to records file (ContentDocument + ContentDocumentLink). How does the component know which file to ...
0 votes
0 answers
93 views
FIELD_INTEGRITY_EXCEPTION when linking new file to Document Checklist Item (ContentDocumentId keeps changing)
We have a long-standing integration that uploads files to Salesforce using MuleSoft and links them to Document Checklist Items via FirstPublishLocationId. Recently, we're seeing the following error ...
-1 votes
1 answer
44 views
how to send a file contentversion as attachment using Messaging.SingleEmailMessage()
I'm receiving the attached contentversion as html instead of pdf, Please find the code below public class ContentDocumentLinkTriggerHandler { public static void handleInsert(List<...
-1 votes
1 answer
485 views
Mass document generation in Omniscript
I have Omnistudio licenses and from a Person Account I can generate documents through templates. I create a screen flow where I choose the template and it generates a preview where I can download it ...
1 vote
1 answer
101 views
LWC bypass apex limits when getting base64 of contentDocument
I'm trying to bypass apex limits when trying to get the base64 content of a content document Sample code below fetchFileAsBase64(contentVersionId) { this.isLoading = true; this.error = ...
1 vote
1 answer
128 views
Show ContentDocument hyperlink in Salesforce LWC
<template for:each={files} for:item="file"> <li key={file.Id}> <a href='{file.ContentDocumentId}'>{file.ContentDocument.Title}</a> </li> </...
-1 votes
1 answer
83 views
How to query ContentDocument of Email Template's Attachments?
I have an Email Template with 3 attachments. I want to query both of those attachments' Content Document. How can I achieve this case?
0 votes
1 answer
976 views
Error details: insufficient access rights on object id
I am facing insufficient access rights on object id while delete document from custom and corresponding contentDocument. @AuraEnabled(cacheable=false) public static void deleteFileRecord(String ...
3 votes
0 answers
83 views
Images or content documents are broken in both Chatter and Apex Page when Cross-Origin Embedder Policy (COEP) is enabled
When turning on COEP, content documents show up as broken in both Chatter and my apex pages that display them. The error I am receiving is Failed to load resource: net::ERR_BLOCKED_BY_RESPONSE....
0 votes
2 answers
702 views
Need a SOQL query to retrieve files from Case object
The UI shows multiple documents associated with a Case. I am attempting to write a query to extract the documents. The query below is not pulling any results back. SELECT ContentDocumentId, ...
0 votes
0 answers
341 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;...
3 votes
1 answer
578 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 ...
1 vote
0 answers
320 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: ...