Questions tagged [contentversion]
The contentversion tag has no usage guidance.
399 questions
-1
votes
0
answers
29
views
ContentVersion giving Insufficient_Access_on_cross_reference_entity
After Uploading a File on File Upload standard component available for Flow screen, I am getting the content Document Ids and from that for some certain users other then System Admin when I am trying ...
0
votes
0
answers
31
views
Is there a way to "copy" an external file from files connect/external data source using apex/salesforce apis?
Context
We have an app that extends Salesforce Content functionality that creates a custom collaboration and approval process experience.
In the app we've developed a custom component that utilizes ...
0
votes
0
answers
188
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;...
0
votes
1
answer
165
views
ContentVersion is not visible but CDL is
The SharingPrivacy (File Privacy) is set as "Visible to Anyone With Record Access".
I've a screen flow (running in system mode). This flow is on the Account record. It is supposed to get all ...
0
votes
1
answer
415
views
Salesforce Apex - POST multipart/form-data Content-Type + TEXT
This is the second case that I open regarding this topic to ask more specific questions (the first Using blob variables in apex code)
In the first one they already indicated to me a first solution ...
0
votes
0
answers
69
views
Can't share a file because it's managed by library , How to share a library then?
i want to create a public link for a file , Class :
public void execute(Database.BatchableContext BC, List<Challenge__c> scope) {
Set<Id> testIsd = new Set<Id>();
...
0
votes
1
answer
108
views
SOSL query on ContentVersion not returning consistent results for all users
I need to search for keywords in some files in Salesforce. I am using the following SOSL query for the same:
FIND {search_term} IN ALL FIELDS RETURNING ContentVersion(ContentDocumentId, FileExtension, ...
3
votes
0
answers
74
views
Why doesn't ContentVersion Query doesn't respect OFFSET when you include VersionData?
I have some code where I have to be careful about how much ContentVersion data I load into memory at any particular time to avoid blowing the heap limit.
I was planning to do an initial query on ...
2
votes
0
answers
59
views
Content Version before trigger data inconsistency issue
I have a before update trigger on content version to update the data of notes object in apex . It is working sometimes but sometimes in the before update the new updated value is not showing . For now ...
0
votes
0
answers
37
views
Content Note Owner loses access to edit Note after an edit by other user, wanted to retain the edit access for owner
If user A creates & owns the note and later other User B updates the same content note then after the update User A will not be able to edit the same note even though User A is the owner. [This ...
1
vote
0
answers
159
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:
...
0
votes
0
answers
61
views
How to give edit access to certain users for ''File Privacy on Records'' field in content version object
I need to give edit access to certain users for ''File Privacy on Records'' field in content version object but in permission set i couldnt find the object content version and even in field level ...
0
votes
0
answers
117
views
API not loading CSV file for Decision Matrix Rows
Using the Salesforce Business Rules Engine, I am able to manually upload a CSV file associated with the Decision Matrix Version to provide the header and rows used for Input and Output values. I am ...
2
votes
1
answer
109
views
Blob.valueOf() creates corrupted .zip for application/octet-stream HttpResponse
I am trying to put application/octet-stream HttpResponse body to a .zip file (ContentVersion).
I am doing it like this:
insert new ContentVersion(
Title = title,
PathOnClient = title + '.zip',...
3
votes
1
answer
82
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();
...
0
votes
0
answers
242
views
Unzip password protected zip file and save the extracted files in Content Version record using LWC
I am working on a problem statement where we need to pick a zip folder from Files related list on Case and then Unzip it and save the pdf files back to Files on same case record. The zip folder is ...
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?
0
votes
1
answer
337
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 ...
0
votes
0
answers
63
views
Error when pulling contentversion data to create file in google drive using python
I am getting an error when trying to create a file in google drive using the salesforce contentversion data url
for (index, row), (index2, row2) in zip(df2.iterrows(),df3.iterrows()):
acid = ...
1
vote
1
answer
1k
views
Uploading Content as a new version via LWC File Upload
I am trying to provide a custom interface for uploading a new version of a file in Experience Cloud. I know folks have asked this before, but with the ability to add a custom field to file upload, I ...
0
votes
2
answers
756
views
Access to ContentVersion record for Community User
In my org, a user with license "Customer Community Plus" is not able to access a particular ContentVersion record. (When trying to access the record using Standard API, a 404 [Not Found] ...
0
votes
0
answers
44
views
File Privacy on Records field is not visible in Edit File details opened from row actions in Related Files
I've included File Privacy on Records field to ContentVersion object layout and it is shown everywhere except when I click "View All" on Files related list on record page and then "Edit ...
2
votes
0
answers
39
views
Standard content version api is storing the binary content as is in the object without converting it as actual file [duplicate]
I am trying to upload a file >50MB to Salesforce Content version object with reference to the Standard ContentVersion API
API Ref: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/...
0
votes
0
answers
59
views
Why does the content version insert fail in a test?
I have a method that
takes a contentVersion where the data is stored locally and
does a callout to transfer it to sharepoint
creates a new ContentVersion with a link to the sharepoint file to replace ...
0
votes
0
answers
180
views
Content Version image link doesn't work on public Visualforce page
I am using Content Version to store images to display them on my Visualforce pages background like :
background : url('{image-link}') center center/cover
To do so, I retrieve the image links via ...
0
votes
0
answers
334
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, ...
1
vote
1
answer
315
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 ...
1
vote
1
answer
111
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 ...
0
votes
0
answers
111
views
Uploading file using multi-part from python
Hello I am trying to upload file to contentversion via rest api tp salesforce using python. I keep getting an error. Can you please let me know how can I form my request so it adds the boundary string ...
0
votes
2
answers
656
views
Question related uploading file using multipart/form-data via postman
I have done the following setup in Postman, but I keep getting following error -
[
{
"message": "Multipart message must include a non-binary part",
"errorCode": "...
0
votes
2
answers
1k
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 ...
0
votes
1
answer
78
views
ContentDocumentLink Trigger successfully blocks file upload on Org but fails in Dev Console
I want to block file uploads (ContentDocumentLink) on a FundingOpportunity object when status is Canceled or Closed. It works fine in the org, but it fails when I tried it on Dev console.
A File is ...
1
vote
1
answer
1k
views
Downloading a file via REST API
I need to download files with the API, using now
data/v59.0/sobjects/ContentVersion/{contentVersion}/VersionData
but
it's returning the entire file as application/octetstream but without a Content-...
0
votes
1
answer
290
views
what is the alternative method "EncodingUtil.base64Encode" in JavaScript or VisualForce?
I have been using EncodingUtil.base64Encode() ; to get base64 contentversion data aiming to send/upload file from salesforce to outside server like AWS S3 which was working fine but due to sfdc ...
3
votes
0
answers
146
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 ...
0
votes
0
answers
22
views
How to sent ContentVersion's VersionData through API? [duplicate]
I am trying to send a pdf file attached to a record of custom object to an external system. I am using ContentDocumentLink and ContentVersion to get the file in apex and make a api call. File is ...
-1
votes
1
answer
851
views
Create a Public Download Link for my Attachment
I have an Object which has attachments and I can access those using ContentDocument and ContentVersions. but when i try to create a download link for the same using ContentDistribution I am able to ...
0
votes
1
answer
82
views
DistributionPublicUrl String length limit
Can anyone know what is the DistributionPublicUrl in ContentDistribution object String length limit in Salesforce ? I was trying to create an DistributionPublic URL whenever a new file is created or ...
0
votes
1
answer
305
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 ...
0
votes
2
answers
608
views
How to write a Scheduled Flow to count how many Notes are related to an Account record?
I'm trying to write a Scheduled Flow to count how many Notes are related to an Account record.
I have a Scheduled Flow on Account that is configured to walk through all Accounts every day.
The first ...
-1
votes
1
answer
867
views
Unable to access ContentVersion.VersionDataURL field
In the documentation of ContentVersion object, VersionDataURL field is mentioned. But when I'm trying to query the same in an Apex class, it is throwing an error saying -
Error : No such column '...
0
votes
2
answers
977
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 ...
1
vote
1
answer
1k
views
I need to convert a String to Blob within a Flow for the VersionData field on a ContentNote/ContentVersion type
I'm trying to insert a File (ContentVersion) or ContentNote with Rich Text within a Flow.
But has anyone encountered the need to convert a string to a blob (base64 encoded type) in order to get a ...
1
vote
1
answer
1k
views
Update ContentVersion custom field by user with Salesforce Platform license
I have ContentVersion record with custom field Status__c. I have apex code updating Status__c field. It is working correctly if I use user with Salesforce license.
The updating user is not owner of ...
0
votes
0
answers
109
views
i've a contentVersionId for which i'm creating a content distribution but i'm receiving INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY,
public static string getDocumetDistribution(Id contentVersionId){
list <ContentDistribution> contentDist1 = [SELECT Id,ContentVersionId,DistributionPublicUrl FROM ContentDistribution ...
-1
votes
1
answer
436
views
Batch Import ContentVersion data via the REST endpoint
I am trying to upload a large amount of photos for Salesforce via the /sobjects/ContentVersion REST endpoint. Currently I am able to use this endpoint to upload one photo at a time. Is there a way to ...
1
vote
1
answer
416
views
How to convert a JSON string stored in a Content Document back to a Map and merge it with a Map of similar type? [duplicate]
I have a Map of type -
Map<String, List<List<LineInfo>>> valuesMapOne = new Map<String, List<List<LineInfo>>>();
This Map is serialized and saved into a ...
1
vote
1
answer
495
views
Locate File IDs of contentVersion and attachment objects that contain a specific word within them
The need is to compile a list of fileIDs of 2 types of Salesforce files that contain a specific word within them.
Document Files in ContentVersion
Email Attachment files in Attachment
When using ...
0
votes
1
answer
610
views
Trigger for Content Version (SNOTE) before Insert
I need to prevent ALL Users from creating a new Enhanced Note (we ended up creating our own object because we needed more customization). I'm trying to write a trigger but am getting stuck on an ...
0
votes
0
answers
465
views
Cannot insert ContentVersion Apex code
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 ...