Questions tagged [contentversion]

The tag has no usage guidance.

77 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
6
votes
0answers
4k views

Best approach for uploading to Salesforce files via a Salesforce API

I need to load files into Salesforce via an API as part of some integration work. I want to be loading files as Salesforce Files (not attachments) so we can version files if need be and I also need to ...
6
votes
1answer
939 views

Files: Why ContentVersion /sfc/servlet.shepherd/document/download/ sometimes sets Content-Disposition=attachment and sometimes =inline

I need to view and PDF file stored as an attachment inside an IFRAME in this context: Visualforce: Why the display of an PDF-File inside an IFRAME works on a Sandbox but not in Production? Inspecting ...
6
votes
1answer
839 views

unable to view contentversion file as public site user

I'm utilizing the following URL to load an image stored as a ContentVersion file in an IMG tag. It loads correctly in SF but not on the force.com public site: /sfc/servlet.shepherd/version/...
5
votes
0answers
124 views

How to detect a size change for a ContentDocument or a ContentNote in a trigger?

Both ContentDocument and ContentVersion have a ContentSize field documented to be: Size of the document in bytes but after adding debug code to check that field for both types for these events: ...
4
votes
0answers
387 views

How can you insert a Salesforce File with Collaborator ShareType?

I am currently trying to insert a Salesforce File attached to a custom Invoice object with the Collaborator (C) permission, as described on the Salesforce Documentation. The code was originally set ...
4
votes
0answers
584 views

Custom field on ContentVersion returning 'NULL' in SOQL even value is assigned into the custom field

I created a custom field lookup of "Account" on "ContentVersion" object, and I wrote a trigger on ContentVersion that will assign "Account" field with a specific Account. Trigger is like this:- ...
3
votes
0answers
69 views

AfterInsert Trigger on ContentVersion addError not working

In Apex using a AfterInsert Trigger on ContentVersion (cv) object, the method cv.addError ('Custom message') is not working as expected. Instead of showing the custom error message the error that is ...
3
votes
0answers
116 views

Trying to save image from Twilio MMS to Files?

I've built an SMS/MMS Lightning Component, which displays incoming MMS images in a thumbnail, and if you click it, a full-size modal display. Now I want to add the option to Save to Files... For the ...
3
votes
1answer
93 views

Is there a limit for number of content folders?

I am getting this error when I try to create a content folder using a visual force page(by inserting a record in contentfolder. As per this link, there should not be any limit for the number of ...
3
votes
0answers
721 views

ContentPublication Limit exceeded in Unit Test

I have Apex triggers on ContentDocument and ContentDocumentLink Sobject. I wrote my Apex Unit Tests for those triggers and I was creating more then one Content Data record to test the Logic in Bulk. ...
3
votes
1answer
972 views

Updating Content records with dataloader

I'm trying to update detail fields on Content records using the Salesforce data loader, as well as dataloader.io. Typically, the uploads have failed w the message "ERROR: You do not have the level of ...
2
votes
0answers
159 views

Is it possible to download archived contentversion or contentDocument

I am having a hard time downloading a contentversion/contentdocument where contentdocument is already archived. I am trying to download the file by hitting rest endpoint services/data/v44.0/...
2
votes
0answers
341 views

When using the /sfc/servlet.shepherd/version/download/<VERSION> url hack to download all related Files, can we rename the zip?

So I've been using the /sfc/servlet.shepherd/version/download/ url method to create a button to download all files related to a record. However I was wondering if there is a way to rename the zip file ...
2
votes
1answer
441 views

no preview for ContentVersion when inserting from Apex

I'm using the following code to generate ContentVersion. String title = 'sample file.txt'; ContentVersion contentVersion = new ContentVersion( VersionData = Blob.valueOf(...
2
votes
0answers
248 views

Rest API - Download times out without any errors

I am downloading ContentVersions through Salesforce using Rest API. I have submitted several file requests and downloaded. After downloading, an observation was that the ContentSize field in ...
1
vote
0answers
24 views

Get ConventVersionId via Connect API

So I'm circling back on a problem I tackled a few years ago, as I needed to update the Chatter API version that I'm using, and in doing so need to rework some code that touched the nasty hack in ...
1
vote
0answers
445 views

ContentVersion file not viewable to Guest Site User

I have Salesforce Files associated with a Contact that I'd like to pluck out the ContentVersion Id in order to display the image on a public-facing Visualforce page (via Sites): <!-- This is ...
1
vote
0answers
149 views

custom files related list component not reflecting new files upload

I have a custom lightning component that displays further details from the contentVersion. the customer requirement is to display both, the standard files related list and my custom cmp. now, when the ...
1
vote
0answers
559 views

ContentVersion custom field permissions

I have added a custom field to my ContentVersion standard object. Community users are uploading files, but I do not want them to be able to view or edit the new custom field. I cannot find where do ...
1
vote
1answer
177 views

How to query contentversion to Email Message

We have integrated Salesfroce and our Support Page, and I have to send emailmessage via rest api along with attachment lies within the email, but I don't find a relateionship between Contentversion ...
1
vote
0answers
100 views

Translate IsPrivate check into Enhanced Notes

I am migrating notes into Enhanced Notes, How do I move the IsPrivate(Checkbox on Notes) values into Enhanced Notes? If the IsPrivate Checkbox is checked on Notes, how can I do this on EnhancedNotes?
1
vote
1answer
359 views

Insert base64 string as attachment using apex dataloader

I have a .csv file which has a column containing base64 string equivalent of a image. Anyway we can load the csv file into Attachments object or ContentVersion object using apex dataloader? I know if ...
1
vote
0answers
1k views

ContentVersion trigger event AfterInsert -> Insert ContentDocumentLink -> FIELD_INTEGRITY_EXCEPTION

We need to get a solution / workaround to insert in ContentDocumentLink several links when a File that has just been inserted (ContentVersion) and sibling records of other Custom Object. A third ...
1
vote
0answers
386 views

Cannot Query ContentDocumentLink as a Portal user

I have a situation where I am trying to retrieve documents which were generated by DrawLoop and added to SFDC as Files. As the System Admin user, I can query for this data using the following query: ...
1
vote
2answers
357 views

Issues downloading docx and xlsx

We are using forcetk REST API for uploading files to contentVersion in salesforce. Everything works fine uploading and downloading files from and to contentVersion. But we are facing some issues while ...
1
vote
0answers
601 views

How to create content version in specific content folder from Apex?

I'm able to create content version and content folder in salesforce files using Apex but can anyone please help me how to create content version in one of content folder . Thanks
1
vote
0answers
56 views

Why doesn't ContentVersion support getUpdated() or getDeleted() calls?

I'm working on backing up Documents, Attachments, ContentDocuments, ContentVersions. It seems that I cannot use getUpdated() and getDeleted() calls on ContentDocuments and ContentVersions. However, I ...
1
vote
0answers
777 views

Access Salesforce CRM Content in Communities & public VF pages

We have a requirement to put a custom download link on VF page for few Salesforce CRM Content. We would like to share few Salesforce content with "Community User" and few Salesforce Content with guest ...
0
votes
0answers
10 views

URL Link to Library Sub Folders

Goal: Provide a direct subfolder link to the user to avoid navigating the library tree folder structure to access the document. In order to get to the Library Sub Folder, I have had to do the ...
0
votes
1answer
22 views

ContentDocument Parent Object ID How to associate

I'm trying to associate some attachment documents with their Parent object, How should I do this? public static void renameFileNameForRelevePromotion(List<ContentVersion> listFiles){ ...
0
votes
0answers
21 views

Email notification on ContentVersion object

I am sending an email notification if a field is changed on Content Version object through Apex as we cannot create Workflows/processbuilder on Contentversion object. In my Apex code, I am referring ...
0
votes
0answers
14 views

Added ContentDocumentLink to Library but Library Members Can't See Record

So I have a ContentVersion that gets added to a record, then I create a ContentDocumentLink record connecting that File to the Library. That Library includes community users. How come they can't see ...
0
votes
1answer
24 views

ContentVersion to be accessible by ALLUsers so community users can see

Currently, adding in ContentVersion records which hold Files. I want them accessible by Community users but the associated ContentDocumentLink is defaulted to view for InternalUsers. Is there a way to ...
0
votes
0answers
24 views

How do I customize the zip file name when downloading multiple files?

I know how to download a single file from salesforce. I just open a new tab with the url /sfc/servlet.shepherd/version/download/068xxxxxxxxxxxxxxx/. Likewise, I know how to download multiple files ...
0
votes
0answers
18 views

While converting classic notes to Lightning enhanced Content Notes getting UNSAFE_HTML_CONTENT error on versionData field.!

We are migrating from Classic to Lightning, In this process we are converting classic Notes to Lightning supported Note (ContentVersion). We have a batch which does this job, getting below error: ...
0
votes
0answers
39 views

Visualforce page rendered as PDF saving to salesforce files (Content document) but failed to reload error on opening pdf

Rendering VF page as PDF. Attachment pdf is working fine in classic. On opening pdf in classic view PDF is correctly opening but when i switch to lightning then on click of button pdf is saved in ...
0
votes
0answers
12 views

Multipart multi ContentVersion Upload with Python Client

i'm trying to upload multiple files (2 in this example) with multipart using a python client. this is my request import requests import base64 import json access_token = "xxxxxx" instance_url = "...
0
votes
0answers
15 views

Content Version export file names

I am attempting to export all of the attachments in our Chatter. I tried to use Data Export to export ContentDocument, ContentFolder, and ContentVersion but the files I got in the ContentVersion ...
0
votes
1answer
24 views

Trigger to populate Last Modified date on Content version?

In the content version, there is a Last Modified Date that populates both the date and time, so I created a custom field called Last_Modified__c with a field type Date that is set to create only date ...
0
votes
0answers
15 views

Display embedded mp4 video from external Content Version

I'm trying to develop a visualforce page which displays our training videos, for this requirement, we want to upload Content Versions to one Enterprise org, make all the videos with public access (...
0
votes
2answers
68 views

Error while inserting contentdocumentlink with Collaborator access through Apex

I have a lightning component which executes an apex class on load. In apex class, I'm getting some list of files and providing 'Collaborator' access to the logged-in user if he is eligible. When I'm ...
0
votes
0answers
20 views

File preview issue of ContentVersion data that is copied from Attachment Body blob

I've created my own custom Solution object for SF Lightning use. I'm trying to migrate existing SF Classic Solution's Attachment Body blob data to ContentVersion versionData blob data. Below is the ...
0
votes
0answers
12 views

Display document based on roles

Will it be possible to display documents based on roles? Example: we have a document tied up with an Account object. There are roles that need to have read only access for Account but should not be ...
0
votes
0answers
39 views

Error while inserting a new revision of a file programatically

I am trying to upload a new revision of a file in ContentVersion object programmatically by Apex. I am getting the below error while inserting a new record of ContentVersion. 15:21:52:424 ...
0
votes
1answer
57 views

Stuck writing a test class for ContentDocumentLink object apex trigger

I am trying to write a test class so that I can send the following trigger live in our production system: trigger updateDocTitleFileExt on ContentDocumentLink (after insert) { for (...
0
votes
0answers
24 views

Sharepoint Files Connect identifiers in Content Version Object

After uploading a Sharepoint file via Salesforce Files Connect, i see a record gets created in Content Version object I want to know one of the field in Content Version (ExternalDocumentInfo2) , how ...
0
votes
0answers
54 views

Has anyone solved the error 415 (Unsupported Media Type) in salesforce?

Has anyone solved the error 415 (Unsupported Media Type) in salesforce ? I tried to upload a file to ContentVersion via rest api request but it 415 error will be returned by my org. Is there any ...
0
votes
0answers
37 views

Attachment's Name field changes after converting to Lightning Files

I am using the tool Magic Mover to migrate Classic Attachments to Lightning files. However, after conversion of an Attachment to a Lightning file, the Attachment's 'Name' field changes. The ...
0
votes
1answer
350 views

How to upload multiple files to ContentDocumentLink Object in one call from a lightning component?

I want to upload multiple files from a public site to salesforce ContentDocumentLink. How I can create bulk of files on javascript (client) side and handle them from apex? Lightning Component: ...
0
votes
0answers
20 views

Inserting a ContentVersion using Angularjs $http + Chatter Rest API

I have been trying to insert files using Salesforce Chatter REST API, but its been documented only for curl. I am unable to find how to do the same in Angularjs using $http with visualforce. I am ...