Questions tagged [contentversion]

The tag has no usage guidance.

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

How to create a public Url for an attachment? [duplicate]

I used a lightning:fileUpload to insert a file into the Attachment object: <lightning:fileUpload recordId="{!v.patientId}" aura:id="fuploader" name="files&...
0
votes
1answer
30 views

REST API service URI Not working from Postman/other REST Clients,but working fine with Workbench

Am trying to Insert/Upload a File(Base64) from Rest Client by mentioning https://mysalesforce-instance.com/services/data/v48.0/sobjects/ContentVersion by giving Body as { "Title":"New ...
0
votes
0answers
18 views

Content Distribution Records are not getting created

I have a trigger which create content Distribution Records. Creating content distribution Record using following code:- ContentDistribution cdist = new ContentDistribution( Name = ...
0
votes
0answers
23 views

upload live camera capture photos only using lightning-file-upload

I have a requirement to upload documents from camera only and not from phone's gallery/album or something like i can check the created/lastmodified date of the file to check if it is captured at that ...
0
votes
1answer
31 views

Content Version SOQL - WIth custom field in the Where clause Return as null

I have a custom field on Content Version - but When I try to have a SOQL and receive the data its return as null. The next line is working : ContentVersion testContentInsert = new ContentVersion(); ...
0
votes
0answers
16 views

Preview Content Version in VF page

I am building a vf page where i am trying to display the preview on the page . I am using the below code . In the code below if i hard code the content version id in the flasvars it works fine but if ...
0
votes
1answer
24 views

ContentVersion apex decoding [closed]

we are saving a docx and pdf files in contentversion. But having issue in decoding it back. Blob.tostring doesnt work as the files encoding is not in the UTF-8 formatting. Can you please help me ...
1
vote
2answers
51 views

upload a file in VF page to content Version is broken

I have a huge and complex vf page (force.com site) - So I will try to explain my issue with an example instead publish here all the code - I hope it will be understanble: I want to upload a file from ...
0
votes
0answers
13 views

Creating Trigger for ContgentNote / ContentVersion etc. to capture Content Body?

I'm looking for the best approach to capture the BODY of a Content Note (Content Document) object when one is inserted or updated. I've enabled the new lightning notes feature in some of my sobject ...
4
votes
1answer
192 views

How to download files, documents (attachments) in salesforce via apex?

I want to download all files associated with records (single or multiple records) of a particular object at one click, using apex. Let's say that there is a custom object myVehicle which holds ...
0
votes
2answers
93 views

Prevent files from being duplicated ContentVersion - ContentDocumentLink

I have button, when click on it, it'll generate a doc and stock it in Files I want to > when i click on that button again, the doc will not be duplicated Code ContentVersion contVer = new ...
0
votes
2answers
77 views

How do I get correct base64 data present in VersionData field in ContentVersion through jsforce?

I am using jsforce to query VersionData field in ContentVersion object. However, it returns me the URL to the base64 data instead of the actual data. If I make a GET request to the URL (using the ...
1
vote
2answers
40 views

BLOB is not a valid UTF-8 string for the Contentversion of einstein_platform.pem file

In Einstein Playground app developed by the Salesforce Lab, I have uploaded the einstein platform service private key file named einstein_platform.pem to complete my einstein platform service setup. ...
1
vote
0answers
76 views

How to upload a Salesforce File using REST API properly?

GET /services/data/v47.0/sobjects/ContentVersion/0000v00000MFIVgAAP/VersionData from this request I will get binary file content, but how can I use this content to recreate the file properly (using ...
0
votes
1answer
23 views

How to subscribe to a ContentDocument using API?

I am trying to develop a Custom UI for subscribing ContentDocument and found out that we have ContentSubscriptionObject which stores subscription information of the document. However we cannot insert ...
2
votes
1answer
40 views

File saved using ContentVersion appears distorted or low quality

Using this link - Convert event.target.files into a JSON string I was able to get the file data. I form a JSON with like - {'fileName':xyz.jpeg,'file': <fileContent>} and pass it to an Apex ...
1
vote
1answer
31 views

Problem in Updating ContentVersion

I am trying to update contentVersion multiple times in code in same transaction. However unlike salesforce records (eg. Account) , contentVersion is holding only first updated value and only those ...
0
votes
1answer
70 views

How to attach contentversion to record in Javascript

I am working on a solution to avoid to surpass the viewstate limit when uploading a file. Currently with javascript I create a record and create a contentversion but the contentversion is not attached ...
0
votes
0answers
31 views

Transfer Notes and Attachments from One Object to Another

need help figuring our my batch job that moves Notes and Attachments from one object(dsfs__DocuSign_Status__c), to its related Account, then delete the notes and attachments after they are moved. I ...
0
votes
1answer
66 views

Python: ContentVersion.VersionData throwing Incorrect padding while decoding to base64 string

I have the following Python code using Simple_Salesforce module: def get_email_template(sf, agreement_id): email_templates = sf.query(f""" SELECT VersionData, Title, PathOnClient ...
0
votes
1answer
39 views

Permissions for Flow Users on ContentDocuments

I have a signature capture screen flow that allows us to get digital signatures for users. When testing as a system admin everything worked as expected but when running as a user they don't appear to ...
1
vote
1answer
54 views

How to disable Salesforce file share email

When the below code runs: ContentVersion doc = new Contentversion(); doc.title = fileId + '.pdf'; doc.versiondata = contentData; doc.PathOnClient = '/filename.pdf'; doc.FirstPublishLocationId = ...
8
votes
0answers
111 views

Are ContentVersion unit tests impossible using a Community user?

I have some unit tests that pass when using System.runAs with standard user but fail when using Communities user. The error is (note the mention of NetworkId): ...
2
votes
1answer
71 views

Test Class for ContentDocumentLink causing Internal Salesforce Error

I have a test class that is inserting a ContentDocumentLink between a ContentNote (SNOTE) and a custom object. Everytime I try the insert it causes an Internal Salesforce Error. I have absolutely ...
1
vote
1answer
120 views

JSForce retreiving VersionData problem [duplicate]

The task: We have over 1500 .msg files in Salesforce, which are Outlook containers for Mail conversations plus attachments. The idea is to build a script, which downloads all files, extract each ...
0
votes
0answers
32 views

How to delete ContentDocument records which is associated with its Parent record , based on Parent Field value?

Parent Object: ccrz__E_OrderShipment__c Field: Status: Cancelled / completed /Process Currently we are deleting the attachment (Doc) which is 180 days old. Now we need to add one more condition that ...
0
votes
1answer
19 views

Report on Notes and Files that are shared with accounts

I have a requirement where I need to get the file names or count of files that are uploaded under each account in Salesforce. I understood that the notes and attachments can be queried from content ...
0
votes
0answers
25 views

Prevent Duplicate files - ContentVersion

I have button which is linked to VisualForce page I don't want the files to be duplicated once i click on that button , Can anyone help me on that please? if(!test.isRunningTest()) body = pdf....
0
votes
0answers
54 views

How to upload image to Salesforce from a native iOS app built using Salesforce Mobile SDK?

I want to upload an image to Salesforce database from my native iOS app built using Salesforce mobile sdk. I heard we should be making use of ContentDocument, ContentVersion & ContentDocumentLink ...
2
votes
1answer
60 views

Why Blob equals doesn't work if one of the Blobs is retrieved from ContentDocument?

In brief, I can't test the value stored in a ContentDocument. Even if the value of the two Blobs is the exact same, equals would return false. Do someone know the reason? Here's a unit test to check ...
0
votes
0answers
139 views

How to use Composite Request to insert ContentVersion?

I am using the composite REST API through a java interface to create files on salesforce. The problem is when I try to open in preview or download the files, the files are corrupt or cannot be opened. ...
0
votes
1answer
21 views

Delete all attachments at a time on a Particular Opportunity Record

I have to delete all attachments related to a particular Opportunity Record based on Id or Name. Currently, I am deleting them manually one by one. Is there any workaround to delete all attachments ...
1
vote
1answer
120 views

jsforce query on ContentVersion returns the url rather than Base64 value

I am using jsforce for fetching ContentVersionData from a Node app. My query is SELECT VersionData FROM ContentVersion but instead of fetching the base64 value in VersionData field i m getting an url. ...
0
votes
1answer
61 views

Content version error 'bad value for restricted picklist'

I'm trying to write a simple trigger to change the picklist value 'SharingPrivacy' on 'Content Version' object when a new attachment is uploaded but I'm getting error 'bad value for restricted ...
0
votes
1answer
194 views

Any way to Query for LinkedEntityId from ContentVersion

Wondering if there is anyway to query for LinkedEntityId from ContentVersion? As i understand, ContentVersion looks up to ContentDocument which then looks up to ContentDocumentLink (could be wrong ...
2
votes
1answer
63 views

In Apex, how do I know if my user can contribute content to a particular library?

Is there a way to discover if the current user can publish content to a specific Library using either Apex or Javascript? Use Case I have a shared library (DeveloperName = Shared_Forms) that many ...
0
votes
0answers
37 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
50 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){ ...
2
votes
1answer
99 views

Is it possible to customize the error message that appears when the user is unable to upload a file?

I'm trying to make a trigger that prevents the user from uploading a file that is larger than 100mb. I'm doing this by checking the file size in the ContentVersion trigger and using addError. However,...
0
votes
1answer
550 views

Open “Content Document Preview” via Lightning Button (Lightning Web Component)

I have a button that should display a PDF to the user when clicked. I want to replicate the behavior of the "Combined Attachments" view in the record's related list, where a click on an Attachment of ...
0
votes
0answers
29 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
28 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
64 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 ...
1
vote
0answers
63 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
49 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
386 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
2answers
80 views

Unable to access versionData from test class

I am facing an issue but I don't know what I'm doing wrong. I'm writing a test class for a code which has this 2 lines: public static Blob getPkpass(){ // more code here... List<...
1
vote
1answer
479 views

ContentDocumentLink fires trigger multiple times on list insertion [duplicate]

We have a trigger on Order attachment insertion, so that a field is populated with a link to the attached documents whenever a user uploads one or multiple files to an existing Order. We created the ...
0
votes
0answers
121 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
38 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 ...

1
2 3 4 5 6