Skip to main content

Questions tagged [contentversion]

Filter by
Sorted by
Tagged with
-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 ...
3 votes
2 answers
4k views

How to upload a file to an external data source (e.g. Sharepoint, Google Drive, etc) in Salesforce via Files Connect

How do you upload a file to an external data source (e.g. Sharepoint, Google Drive, etc) in Salesforce via Files Connect? Is this even possible. I've read the Salesforce articles, I've watched a ...
8 votes
1 answer
608 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: ...
7 votes
1 answer
4k 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 ...
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
1 answer
1k 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 ...
3 votes
1 answer
1k 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 ...
0 votes
1 answer
2k 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
2 answers
5k 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 vote
1 answer
5k 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. ...
2 votes
3 answers
1k views

How can I preview entire ContentVersion file (not just the first page)?

I am using the following URL format to preview a PDF ContentVersion file inside a LWC: /sfc/servlet.shepherd/version/renditionDownload? rendition=SVGZ&versionId=0687Z000002EkVc&...
2 votes
1 answer
2k 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
1 answer
2k 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
2 answers
4k views

How to have NetworkId (Community Id) logic working in both production and unit tests?

Some existing product code that creates ContentVersion instances is now being called from a community and the code fails with: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, You do not have the level ...
3 votes
2 answers
6k 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[NavigationMixin....
30 votes
2 answers
45k views

Content Document download URL params

I spend hours to find a way to control download behavior of pdf-files (when to download and when to show inline) and did not find anything. What I got so far: the main thing that do all files magic is ...
2 votes
1 answer
1k 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(...
1 vote
1 answer
2k 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
1 answer
1k views

Creating a contentworkspaceDoc?

I am trying to create a contentworkspaceDoc , contentWorkspaceDoc allows a document to be shared with multiple libraries. I am have a query where I pull all the existing contentworkspaceDoc from the ...
0 votes
2 answers
3k views

content version - clone from one object to another

I am trying to clone File(s) from a parent object to child. The code I am using is doing that but the file type is set to "LINK" while doing so, and I am unable to open that file or it has nothing ...
2 votes
1 answer
1k views

Delete a ContentDocumentLink of Library file

I have inserted a file in Library. I want to delete the ContentDocumentLink by which it is shared with the Library. I have created new ContentDocumentLink where I have shared file with a user. But ...
0 votes
2 answers
3k 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 ...
6 votes
1 answer
3k 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/...
1 vote
1 answer
2k views

Import Files and Attachments to the ContentVersion object using CSV file and Dataloader

I am working on migrating files from an old SF org to a new one. I have done a data export on the required files and documents using the native Data Export tool in the Setup. That gave me the ...
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
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
1 answer
937 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
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
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>(); ...
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',...
1 vote
1 answer
1k 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. ...
-1 votes
1 answer
9k views

Open PDF in browser instead of Downloading

Using sfc/servlet.shepherd/version/download/{!id} in URL to download PDF files from ContentVersion in a public site. Is there anyway to get a PDF file to open in a browser instead of Downloading it ...
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
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 = ...
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 ...
5 votes
3 answers
2k views

Download ContentVersion Object as JPG using JSForce

I am trying to download a JPG file stored as an attachment in Salesforce, to the local machine. I have a URL that works correctly when using a GET request in Workbench. When I try to do the same in ...
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 ...
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 ...

1
2 3 4 5
8