Questions tagged [contentversion]

The tag has no usage guidance.

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

ContentDocumentLink and ContentVersion Migration from Org source to Target

As part of a migration project, I want to migrate all contentVersion and contentDocumentLink from an Org A to an Org B. my files are spread over 7 custom objects and 3 standard objects I want it to be ...
0 votes
1 answer
33 views

Post request with polymorphic field on the body

I am trying to send a post request to ContentVersion to migrate my contentVersions from point A to B : i build the body like this : body = ('{"Title" :"'+Title+'", &...
2 votes
1 answer
51 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 ...
  • 324
0 votes
0 answers
20 views

INVALID_CONTENT_TYPE, Content deliveries cannot be created for a reference file

I am trying to create a public url for images shared via SharePoint integration to salesforce using files connect. I am getting the error.. System.DmlException: Insert failed. First exception on row 0;...
  • 321
1 vote
0 answers
70 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 ...
-1 votes
1 answer
31 views

update ContentVersion using rest API

I have some data on the ContentVersion object. I want to update the field VersionData in the ContentVersion object using REST API. Here is some more detail about the API. Endpoint: https://mysite.my....
0 votes
0 answers
59 views

Sending an image as a POST request

I am trying to make a POST request to Eventbrite API to send an image from Salesforce along with other parameters. Under the hood Eventbrite is using Amazon AWS S3 bucket. When I send the request ...
2 votes
1 answer
61 views

REST endpoint ContentVersion creation succeeds in synchronous mode but fails in Queueable for site guest user

I have a REST endpoint that, when called by a guest user, creates a ContentVersion file. When the process happens synchronously, the ContentVersion file gets created without issue. However, when the ...
1 vote
1 answer
35 views

Uploaded audio file to salesforce ContentVersion getting corrupted

I need to upload a Zoom recording as ContentVersion to salesforce using the recording file donwload_url. What I've done so far is this: // Get download_url field from Zoom file returned by api const ...
  • 111
2 votes
1 answer
60 views

LWC download shows 'errorduringprocessing.jsp'

On our customer portal, we provide the option to download ContentVersion from Salesforce using the following endpoint: /sfc/servlet.shepherd/version/download/{ContentVersionId}. And we open it with ...
  • 21
1 vote
0 answers
73 views

Encode/Decode ContentVersion Rest API Export and Upload [duplicate]

I’m working on a small python script to export ContentVersion records from one Salesforce org and migrate them into another. I’m using simple-salesforce. I am able to export the ContentVersion and the ...
0 votes
1 answer
28 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 ...
  • 14k
0 votes
1 answer
83 views

Preview entire ContentVersion (not just 1st page)

I am using the following command to preview a PDF ContentVersion file inside a LWC: /sfc/servlet.shepherd/version/renditionDownload?rendition=SVGZ&versionId=0687Z000002EkVc&operationContext=...
  • 31
0 votes
0 answers
32 views

Uploading an image via REST API [duplicate]

According to this blog, I'm trying to upload a file to salesforce, and link to the file from a case. This is part of ny code: const base64Content = fs.readFileSync('/home/***/Desktop/version.png', { ...
0 votes
0 answers
64 views

Portal users have no access to files (ContentVersion)

I am displaying in my Experience Cloud portal images uploaded as ContentVersion files. Users can see images properly, but only when logged in to portal as "Log in to portal as user" button ...
0 votes
1 answer
55 views

Mistake is SOQL query

When I searck content document by Id I see the result, but when I search by title the result is missing. The problem appears when someone else create document. When I create documents, everything is ...
  • 29
1 vote
0 answers
39 views

Is't Possible to update the ContentDocumentId field value of ContentVersion in Before Insert trigger? [closed]

I would like to update the ContentDocumentId of ContentVersion record in the before insert trigger. Is this possible? If it's not possible can anyone please explain the reason for it? Update: When a ...
0 votes
0 answers
30 views

a method in contentversion trigger return "List index out of bounds: 0"

i am making a content release trigger with a method to update the mobile business app for my work. The objective of all this is to send the data stored by the SNOTES and store it in the backend of the ...
  • 21
0 votes
1 answer
53 views

Can't update ContentVersion. My code create new file every time

I had such issue. I created method that save attachent to my Opportunity. public PageReference attachInvoicePDF() { /* Get the page definition */ PageReference pdfPage = Page....
  • 29
5 votes
1 answer
168 views

Hide related list on Content Document page in experience cloud

Is there a way to hide these related lists? I finally got this url (https://HOST.cs66.force.com/PORTAL_NAME/s/contentdocument/contentDocId) which shows the content document and we can preview ...
  • 85
1 vote
0 answers
74 views

Prevent creating new file while uploading new file from Salesforce standard upload button

Whenever a user uploads a new file under a particular record, I need to check for an existing file with the same name. If there is an existing file, then it should not create a new document; instead ...
0 votes
1 answer
309 views

Trouble getting VersionData from ContentVersion through REST API - always returns null

I am trying to retrieve the binary file data from a ContentVersion. As i understand it, you get this from making a GET request to the value that is stored in VersionData on ContentVersion. For me it ...
0 votes
0 answers
95 views

Error on Inserting a ContentVersion with the REST API from Javascript: "Non-binary part must be JSON or XML"

I am trying to use the Salesforce REST API to insert an JPG as a ContentVersion in Salesforce. I'm using an Ionic Capacitor mobile app with the capacitor-community/http plugin. If I'm reading the ...
  • 617
3 votes
1 answer
141 views

File corrupted on sending data to create file via workbench using REST API

I am trying to create a file in in salesforce via workbench. The file is getting created although the file is corrupted. I feel there is some issue in binary data. What I am doing to get the binary ...
  • 71
1 vote
0 answers
88 views

Field Permissions on ContentVersionHistory

I'm trying to display field history for some custom fields on the ContentVersion object. This object has some interesting properties, one of which is that field security cannot be explicitly set on ...
0 votes
2 answers
116 views

Adding 1 required field on the content version object

So right now I have a contentversion that I want to put in an additional field. If I did not put the required on the field I can successfully upload a file but the file just uploads and there isn't ...
  • 35
0 votes
0 answers
24 views

Integration batch job + Data Encryption : Need some suggestion

I have written a batch job to push Open Case record every one hr from Salesforce to External system using REST API. I need to Encrypte the data and push it to the external system. Below is the Class ...
  • 679
2 votes
1 answer
100 views

Is it possible to retrieve actual data of the ContentVersion record by using the Salesforce CLI?

I would like to retrieve the Base64 data of the ContentVersion file stored in my Org. The requirement is to do so by using the Salesforce CLI, though. I identified two potential commands that could ...
0 votes
1 answer
261 views

Getting error while upload file

I am trying to upload file in the files section in lightning. i am getting below error - I am getting this error only when attaching an email message which has a pdf attached to it. I tried ...
  • 1
0 votes
1 answer
113 views

Sorting ContentVersion based on Related objects like Account, Contact

I want to build a photo gallery where I can sort Images based on accounts, contacts or any other object. But not able to do so due to Data model of ContentVersion/documents. I can't sort ...
  • 3,315
0 votes
0 answers
211 views

Create public link for external user on file upload

I am trying to create a public link for the external user to download the same file uploaded by him as guest user. So when an guest user upload a file and he try to download using "baseUrl/sfc/...
  • 3,711
0 votes
1 answer
270 views

How do I convert a ContentVersion record to JSON to pass via API?

I need to share files attached to an account externally via API to another Salesforce org (to recreate the files there). In order to do this I'm trying to create a JSON file to contain the file/s ...
  • 1,409
0 votes
1 answer
1k views

How to derive a direct link to a file from the link to the download page?

I have publicly accessible files in Salesforce (accessible by anyone, even without a Salesforce license), which can be accessed via URLs such as this: https://XXXXXXXX.my.salesforce.com/sfc/p/#...
-2 votes
1 answer
81 views

How we can convert contentVersion Title to string ,i am getting some type casting error [closed]

Please help me where i am writing wrong.
1 vote
1 answer
601 views

How can I preview an entire file with lwc in community?

the lwc file preview is not compatible with community : https://developer.salesforce.com/docs/component-library/documentation/en/lwc/use_open_files I tried this alternative : this[...
1 vote
0 answers
577 views

Sending Files From Salesforce using REST

We have a process in which we need to send a JSON of leads every day to an external system (Not Salesforce). Until now we just created the JSON with the desired data and sent it via REST. From time to ...
  • 963
0 votes
0 answers
335 views

Export all documents in content document / content version

We have a requirement where we need to periodically export all documents out of salesforce. I tried the following: Data loader / dataloader.io but then these gives export in csv file and the content ...
0 votes
1 answer
607 views

Problem Querying Fields on ContentVersion When User is not the Owner

UPDATE This can reproduced in any org, so it may be designed behavior or a bug. Basically, if a user is not the owner of a ContentVersion record they will only be able to filter by Id or ...
  • 775
2 votes
0 answers
63 views

Connect API - set ContentVersion custom field on file upload

I'm trying to upload a file with the following request: curl -H "X-PrettyPrint: 1" -F 'json={"title":"BoatPrices"};type=application/json' -F "fileData=@BoatPrices....
-1 votes
2 answers
464 views

get Actual content from a file from ContentDocumentId

I have written a query i.e : List<ContentVersion> contentversion = [SELECT VersionData,ContentBodyId,ContentDocumentId FROM ContentVersion WHERE Title =:customLabel]; Here I am getting all the ...
0 votes
0 answers
172 views

The field VersionData not queried in SOQL for ContentVersion sobject

I queried the ContentVersion object by following soql, VersionData field is not retrieved in results. SELECT Id, Title, VersionData, PathOnClient, ContentSize FROM ContentVersion WHERE Id=<Id> ...
3 votes
1 answer
326 views

How to find enhanced domains enabled in salesforce org via apex?

I am looking for ways to find out whether salesforce org is enabled with enhanced domains or not via apex. As per this document, the content (files) domain is different in each case. And dynamically ...
0 votes
1 answer
798 views

A trigger on contentVersion object with additional logic

I have a trigger on contentVersion. I also have a custom Object named (Term_and_condition__c). Whenever I attach some file to my custom object's (Term_and_condition__c) record, my trigger gets called. ...
0 votes
1 answer
209 views

APEX Class invoked by flow to delete Content Documents, get DML exception on delete "ENTITY_IS_DELETED

I have made this simple class to assist a flow to delete content documents, it is working just fine in my apex tests but when I invoke it from a flow I get the following error message: 13:35:33:092 ...
1 vote
1 answer
528 views

How to get Salesforce content files base URL via Apex?

As per this salesforce help document, the content files base URL is different compare to the salesforce org domain URL. The domain URL formats with or without enhanced domains are as follows //with ...
1 vote
2 answers
846 views

How to get Binary Data to submit to REST API

I'm attempting to use curl and multipart message to attach files to a created record. I am successfully able to do so, however the file is corrupted when I view it. I think I may not be getting the ...
0 votes
1 answer
69 views

How to run the code when the parameter was passed

I am facing the problem that I cannot run the code because there are no triggers to run it. I need the pdf file to be previewed in the module window. Tried through conectedCallback and wire, it didn't ...
  • 13
1 vote
1 answer
357 views

ContentVersion/ Content document link share files with partner users

I have a requirements that I need to share files with particular user which belongs to partner community user through trigger/apex code. I am using the below hard to test. But finding some issue. ...
  • 644
0 votes
1 answer
512 views

Contentversion ContentDistribution public link creation

I have to create public link for files. I have inserted 'ContentVersion' and 'ContentDistribution' and created 'DistributionPublicUrl'. I am able to create public link ('DistributionPublicUrl') but ...
  • 644
0 votes
0 answers
145 views

how to get versiondata parameter value by using file URL?

We are passing file URL in one custom field & want to create a content version record by using that URL. But we are not getting how to pass or get the versionData parameter of that file by using ...

1
2 3 4 5
7