Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

Questions tagged [contentversion]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
0 answers
35 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 ...
user avatar
0 votes
2 answers
23 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 ...
user avatar
  • 25
0 votes
0 answers
15 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 ...
user avatar
  • 659
-1 votes
0 answers
16 views

Scheduled flow - ContentDocument Link

I have a scheduled flow that runs daily and checks if the Case record has a content Document attached to it, I'm using the get record element to get all contentDocument Links related to the case ...
user avatar
2 votes
1 answer
22 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 ...
user avatar
0 votes
1 answer
27 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 ...
user avatar
  • 1
0 votes
1 answer
23 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 ...
user avatar
  • 3,309
0 votes
0 answers
67 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/...
user avatar
  • 3,671
0 votes
1 answer
54 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 ...
user avatar
  • 1,387
0 votes
1 answer
146 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/#...
user avatar
-2 votes
1 answer
46 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.
user avatar
0 votes
0 answers
126 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[...
user avatar
1 vote
0 answers
102 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 ...
user avatar
  • 961
0 votes
0 answers
75 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 ...
user avatar
0 votes
1 answer
235 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 ...
user avatar
  • 765
2 votes
0 answers
40 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....
user avatar
-1 votes
2 answers
99 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 ...
user avatar
0 votes
0 answers
115 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> ...
user avatar
1 vote
0 answers
76 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 ...
user avatar
0 votes
1 answer
361 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. ...
user avatar
0 votes
1 answer
91 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 ...
user avatar
1 vote
1 answer
264 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 ...
user avatar
1 vote
2 answers
368 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 ...
user avatar
0 votes
1 answer
68 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 ...
user avatar
  • 13
0 votes
0 answers
140 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. ...
user avatar
  • 624
0 votes
1 answer
180 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 ...
user avatar
  • 624
0 votes
0 answers
80 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 ...
user avatar
0 votes
0 answers
270 views

Pushing content version (>50Mb) via REST API

We are pushing / inserting files larger than 50Mb which is the reason we are using multipart messages to push the data and this is being done via node.js Now, the issue that I am facing is on the ...
user avatar
  • 4,313
0 votes
0 answers
21 views

Error with ContentDocumentLink insert null pointer

I am trying to create a salesforce file and link to it.But when i run the code i get an error BeforeInsert caused by: System.NullPointerException: Attempt to de-reference a null object on the line ...
user avatar
  • 1
1 vote
0 answers
195 views

Sub-query issue on ContenDocument and ContentVersion

I have a list of ContentDocument IDs which are all tagged to the same Sobject, when a ContentDocumentId is selected, I want to retrieve only its latest ContentVersion data based on the ...
user avatar
0 votes
1 answer
196 views

System.StringException Invalid Id [closed]

I'm getting this error in APEX class which converts CSV file into records. I'm sorry for bad editing of this question but I turned problem liner into quotes. Example of the data that causes the error: ...
user avatar
  • 11
0 votes
0 answers
254 views

How to create contentversion by using file url?

We want to create ContentVersion related to the account object. We have one field on account which contains the URL of the file(png/jpg/pdf). And by using that URL we want to create ContentVersion. ...
user avatar
0 votes
0 answers
16 views

Can we check user have permission for creating Content Distribution records or not?

I am trying to find out can we check whether a user have permission to create content distribution records or not. Permission to create Content distribution records depend on the folder in which we ...
user avatar
  • 3,309
0 votes
1 answer
368 views

In Asynchronous using Rest Api Error: System.LimitException: Apex heap size too large: 19312398

I got the error as heap size limit too large, I'm able to send below 2MB file by using Asynchronous method but the limits is 12MB and trying to send 12MB file to external system by using Rest Api. ...
user avatar
0 votes
1 answer
142 views

How to read version data in Salesforce

From Salesforce File, I want read the file and get the content between some text and store it in the Custom object record field. For this i have created external API(python script deployed to heroku) ...
user avatar
1 vote
1 answer
106 views

I have used Multipart/message but still i got the error as heap size limit too large. I'm able to send below 2MB file

I have used Multipart/message to send Large size of file from Salesforce to External system. but still I got the error as heap size limit too large, I'm able to send below 2MB file. Source Org public ...
user avatar
0 votes
0 answers
37 views

Contentfolder object capturing Id in the Name field on adding a library and folder inside of it. Is that correct?

I have created a library and subsequently, created two folders inside of it. Then, I went to the workbench to see how data is stored in ContentFolder object. Records are created and the Name column ...
user avatar
  • 6,614
0 votes
0 answers
16 views

How to write the code for Multipart/message in Rest api to share large size of file ContentVersion? [duplicate]

Im able to send a file till 2MB of the file size but I need to send a maximum of the file size in REST Api. so I need to update this code by using Multipart message.. Sourch Org Code public class ...
user avatar
0 votes
1 answer
147 views

How to access files from a particular folder in a library to send it as attachments through an email?

I am trying to find a way to query files from one of the folders in a library. I am seeing there is no strong direct relationship between library and folder it seems. My use case is, I need to query ...
user avatar
  • 6,614
1 vote
1 answer
406 views

How we can read Content Version body and update in Long rich text area field of an object?

I have file attached (Word Document) to the custom object record . I want read the file and get the content between some text and store it in the Custom object record field apex: ContentVersion con =[...
user avatar
0 votes
1 answer
384 views

While Inserting a ContentVersion through Apex i'm not able to get the Image of the File [closed]

Target Org Code @RestResource(urlMapping='/getContentVersions/*') global with sharing class ShareFileRest { @HttpPost global static String getFileToStore() { RestRequest req = RestContext.request;...
user avatar
1 vote
1 answer
174 views

ContentPublication Limit exceeded in Test Class?

Is the content publication limit applicable to test class as well? All i am doing on my test class is to create a contentversion record. It still says that ContentPublication Limit exceeded. Does ...
user avatar
  • 11.9k
0 votes
0 answers
94 views

Content Version's Content Size

i am unable to pass values to Content Version's ContentSize Field. i am getting this compile error: Field is not writeable: ContentVersion.ContentSize here is my sample code: trigger ...
user avatar
  • 73
0 votes
2 answers
316 views

How to query the Content Id of a File?

After creating a public link of a File using ContentDistribution, you get the below URL https://--c.documentforce.com/sfc/dist/version/renditionDownload?rendition=ORIGINAL_Jpg&versionId=...
user avatar
0 votes
1 answer
499 views

Update OwnerId of ContentDocument from Apex class

I need to update OwnerId of ContentDocument in my Apex class.For thati am updating it like this: if(!participantDocumentsOwnerId.isEmpty() && participantDocumentsOwnerId.size() > 0 &&...
user avatar
0 votes
1 answer
62 views

Testclass for wrapper class implements Comparable and contentdocumentlink

I don't know how can I test my contentdocumentlink, in the log I got the information EXCEPTION_THROWN [18]|System.QueryException: Implementation restriction: ContentDocumentLink requires a filter by ...
user avatar
  • 431
0 votes
1 answer
108 views

Deleting an attachment of case deletes content document and not content version & how to create a new content version for the same content document?

I have a requirement where when I attach or delete a file in attachments of a Case I have some fields to updated accordingly. I have noticed that when I insert an attachment, the Content Version ...
user avatar
  • 456
0 votes
1 answer
951 views

Preview is not available for content documents

I have enabled lightning knowledge in our developer sandbox and we have content documents in the files related list. But we can't see the file preview and giving an error saying preview is not ...
user avatar
  • 41
0 votes
1 answer
596 views

Community User cannot download or preview docx file LWC

The url for preview and download of a docx file is not working on Community. The ContentDocumentLink is connected via the LinkedEntityId field to a custom sObject called SupportingDocuments__c, which ...
user avatar
0 votes
0 answers
1k views

Get Base64 Encoded binary data from file in Apex

I am trying to generate binary data from files in base64 encoded format in Apex. The purpose is to send that resume data to an external system so that they can parse and send it back. I was able to ...
user avatar

1
2 3 4 5
7