Questions tagged [contentversion]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
6
votes
7answers
9k views

uploading files in contentVersion using lightning component

I am developing a lightning component to upload files in the contentVersion object. I used this site as a reference: http://peterknolle.com/file-upload-lightning-component/ I was able to ...
3
votes
1answer
3k views

ContentVersion Content-Type

I need to stream a file from Salesforce in our webapplication. To make sure the file is properly opened, I have to set Content-Type header. How to retrieve the Content-Type (MIME) of a file? I ...
2
votes
2answers
2k views

Issue Setting ContentVersion Owner

I am getting an attachment via a Salesforce email service and in the Email service apex class logic, I query the user object by the email from address and set the ContentVersion owner as the user ...
3
votes
2answers
6k views

ContentPublication limit exceeded

Is there a limit on the content publication ? Is this the same as content version? The docs say "The maximum number of versions that can be published in a 24-hour period is 5,000. " Does this ...
10
votes
1answer
6k 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 ...
4
votes
1answer
2k views

How to upload an Excel file into ContentVersion Object

I need to upload an Excel file on an opportunity. I want to user ContentVersion standard object to store these excel files. Can anyone please explain or share a code snippet to show how can we ...
4
votes
1answer
5k views

A link to Content documents from a VF page

I am managing my document in SF content library. I want to include a link to some documents in a VF page BUT I don't want the link to open the document preview on the Content tab. I would like the ...
2
votes
2answers
6k views

Get all documents in content belonging to a particular library in SOQL

I need to get documents of a particular library using SOQL. SELECT title FROM ContentVersion where Contendocument.Parent.Contentworkspace.name='EMEA Sales' The error i get is INVALID_FIELD: on ...
1
vote
2answers
1k views

I want to associate File With Custom Object but getting Error

I am trying to create new File through ContentVersion and Associating it with Custom Object ParentId is ID of Custom Object . Error given is Document: You cannot create a link for a document in a ...
7
votes
1answer
864 views

Visualforce: Why the display of an PDF-File inside an IFRAME works on a Sandbox but not in Production?

On a Visualforce page I have an IFRAME like this: <iframe class="viewer" src=""></iframe> It starts up an shows nothing because src is blank. Good. To store the actual PDF I upload it as ...
10
votes
1answer
158 views

SOQL: (WHERE x IN(a,b)) does return 2 records, but (WHERE x = a OR x = b) returns only 1 record… Why?

I'm trying to retrieve some ContentVersion records, but I'm having a lot of issues with it. After some research it seems as if the records are divided into two 'sets' as it were, and Salesforce in ...
6
votes
1answer
977 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 ...
5
votes
2answers
4k views

Can't we query ContentVersion to get the file posted on the Object?

We have VF page that allows a user to upload an attachment that we later convert to FeedItem. THe VF Page also allows updating the FeedItem by inserting a new ContentVersion. The whole thing works ...
5
votes
2answers
4k views

Trigger on ContentDocument not working

I am trying to setup triggers on ContentDocuments. The following link says that this is possible https://developer.salesforce.com/releases/release/Spring12/contentdocument+triggers I am able to ...
4
votes
1answer
387 views

Is it possible to update “Featured Content” in Salesforce Content?

Featured Content is a neat way to promote certain items in SFDC Content. From the documentation: Featured Content This section lists the five pieces of content in your libraries most recently ...
2
votes
1answer
2k views

Migrating Chatter files attached to feed comments

I am ultimately trying to use data loader to migrate our chatter posts & comments that have files attached to them. They were originally added by uploading directly from computer to the comment. ...
1
vote
1answer
486 views

Rating content from apex/visualforce [closed]

Within a Visualforce page, how can I enable external community users to rate a Salesforce CRM Content document with thumbs up or thumbs down? I'm basically trying to create a custom version of the ...
1
vote
1answer
497 views

Cannot use StandardSetController with ContentVersion?

I am trying to display a list of documents stored in Salesforce CRM Content on a VF page using JQGrid. I used OFFSET for paging. Since the number of records is more than 2000, I wanted to use ...
3
votes
3answers
3k views

File Attachment not working when attaching crm Content

I have a page where the user selects content (that is 5MB or lower, only 2 attachments allowed per email) to use as an attachment in an email. It all seems to work fine, the email sends and there are ...
3
votes
1answer
416 views

ContentWorkspace Permission And Migrating

I am working on an instance that has a large set of ContentVersion data uploaded by Customer Portal Users and saved across many ContentWorkspace(s) or Libraries. We have encountered some issues ...
2
votes
2answers
562 views

Specify ContentSize when creating new ContentVersion in UnitTest

I used the post: Test class for contentdocumentlink as a model, however, when I attempt to define my own ContentSize for the ContentVersion document I receive: Field is not writable: ContentVersion....
2
votes
1answer
389 views

ContentVersion's SharingPrivacy acceptable values

According to the ContentVersion documentation under SharingPrivacy, it mentions: Controls sharing privacy for a file. Only administrators and file owners with Collaborator access to the file can ...
2
votes
1answer
4k views

How to Test ContentWorkspace, ContentDocument & ContentVersions

So I have some apex code that is query some Content Workspaces, Documents and Versions. As far as I can tell these are ready only in Apex. Error: Field is not writeable: ContentDocument.Title ...
2
votes
0answers
794 views

Display image from “Files”/ContentVersion in VisualForce [duplicate]

I'm working on a project where I'll be using VisualForce to render custom PDF service reports. So my page will take in the ID of a Service object (from Field Service Lightning) and populate all the ...
1
vote
1answer
868 views

ContentDocumentID is not available just after ContentVersion getting inserted But available after soql query

I am inserting ContentVersion as following:- String yourFiles = 'Lets assume this is your binary string of the files'; ContentVersion conVer = new ContentVersion(); conVer.ContentLocation = 'S'; // S ...
1
vote
1answer
74 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
2answers
567 views

How to insert ContentVersion with preview in files?

I can insert an image, but it's without preview. I can open the image after downloading, but a need preview. It writes in files "No preview available". How to fix that? Here is my code. js: ...
0
votes
1answer
62 views

Fetch Files Related to opportunity in salesforce

I want to run a SOQL query that fetches files associated with opportunities(in a particular stage). If I am not wrong content version is the actual object I need to be querying on to fetch content? ...
0
votes
1answer
409 views

Fetching all the content notes related to an Event

Requirement I have to fetch all the content Notes that are associated to events created after 01-Aug-2016. Logic path I have taken the following path to get to content notes fetch events find ...