Use this object to retrieve, query, update, and delete the latest version of a document, but not a content pack, in a library or a file in Chatter.

learn more… | top users | synonyms

1
vote
1answer
17 views

Not able to cover batch class which is deleting expired content document

I am writing test class for batch class which will delete all the content documents which are expired. And I am getting this error "System.SerializationException: Not Serializable: com/salesforce/api/...
0
votes
1answer
18 views

Report on Opportunities and their attached files

Is it possible to run a report on opportunities and attached files? We attach our files via Chatter. I created a report type for Opportunities with Content Documents, but it comes up with no results. ...
1
vote
0answers
22 views

Pull ContentDocuments through the API

We are trying to pull all of the ContentDocuments out through the API as an admin user, but we are having issues. Unlike the UI, the APIs do not allow listing all the records in Content, even for ...
0
votes
0answers
18 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
0
votes
0answers
19 views

Report on all Files (ContentDocuments)

I need to report on all Files. I understand that they will not appear on a report unless in a library, but even when I share a file with a library, it does not appear on a report of "Content" report ...
3
votes
1answer
97 views

Apex Query on ContentVersion object and get all record

Apex Query on ContentVersion object and get all records, but the record are coming on current login user owned, not all records are coming. for example i am login with administrator account and want ...
0
votes
0answers
14 views

Email notification when a document is archived

We have provision to get an email when a document is uploaded to the library or when a new version of the document is updated by subscribing to the library and the document respectively. But is there ...
2
votes
0answers
137 views

Attach ContentDocument to record [closed]

Maybe someone knows how to attach ContentDocument to record through Apex? I need to copy ContentDocuments (which are in Google Doc's, Notes and Attachments related list) from one Object to another. I ...
0
votes
1answer
158 views

Compile Error: Non-void method might not return a value or might have statement after a return statement. at line 17 column 9

upload any file upto 2 gb from content version @RestResource(urlMapping='/DragAndDrop/v1/*') global with sharing class DragAndDropRESTAPI { @HttpPost global static String attachDoc(){ ...
0
votes
0answers
86 views

Unit Test for contentDocument

I am having some difficulty understanding how to design a unit test that works with content documents, particularly when they are attached to records. The use case I have is we want to protect all ...
0
votes
1answer
60 views

Unable to cover to test class for below trigger

I have written trigger and a test class for my content version Handler public class handlerClassContentVersion{ public set<string>prodNames = new set<string>(); public set<...
0
votes
1answer
46 views

Insert ContentDocumentLinks for Chatter Content Posts

We have a set of ContentVersion records that have been inserted by users via a FeedItem post. Unfortunately because Chatter groups has many functional limitations we have to migrate these files to ...
1
vote
0answers
14 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 ...
0
votes
0answers
74 views

How to programmatically set File/Feed Item Permissions

There are a couple of questions already similar, but not quite the same - we are in quite a bind, every fork in the feed item/content road has been a total dead end, after almost 9 years on this ...
1
vote
1answer
165 views

Querying ContentVersion or ContentDocument for User Other Than Owner - Only One Record At a Time?

My issue is that I can't seem to query more than one record at a time from the ContentVersion or ContentDocument if I'm not the owner of the file. Here is what works for me: Map<Id,...
5
votes
1answer
157 views

Winter 16 Release - “new” Notes

As part of the Winter 16 release, in addition to the lightning experience Salesforce rolled out some new Notes. I enabled the new notes, however we are keeping salesforce classic experience for now. I ...
3
votes
1answer
62 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 ...
4
votes
1answer
65 views

ContentDocumentFeed vs FeedItem

TL;DR: Question about the ContentDocumentFeed object and the FeedItem object: which is the one I want to use when accessing files uploaded through the Salesforce Files Sync tool? I can see that both ...
0
votes
0answers
99 views

Getting the list of members of a ContentWorkspace(Library) in apex

I have a requirement to send an email to all the members of the ContentWorkspaces to which a ContentDocument belongs. I have got the list of Content workspaces to which that document belongs. But how ...
0
votes
2answers
35 views

Document Upload and show as a link

We have a word file whose size is 15 MB and want to download it thorugh a link from Home page. However, as the standard document tab can only accept till 5 MB document size, it is not fulfilled. ...
0
votes
0answers
90 views

Upload File (image/audio/video) to FeedItem in chunks

​public static String upload(String folderId, String documentId, String fileName, String base64BlobValue) { if(documentId == '' || documentId == null) { Document document = new ...
1
vote
0answers
25 views

Moving archived content from one Salesforce Library to another

I am trying to move archived content from one library to another. We are consolidating libraries and remapping content, but dataloader does not allow you to move archived content. Suggestions?
0
votes
0answers
23 views

Salesforce CRM Content library considerations

Can we use salesforce Content Management as document repository? If no then what are the alternatives. If yes what is the limit on no of docs that can be uploaded by a user. I have gone through the ...
1
vote
1answer
708 views

Retrieve all ContentDocument Ids whose related ContentDocumentLink record is updated/added

I want to retrieve File Ids for which new entry has been added or removed from child ContentDocumentLinks relation. Following is the parent to child relationship query I made for retrieving Ids, title ...
3
votes
1answer
539 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 ...
1
vote
1answer
129 views

How to delete ContentDocumentLink records massive

I want to free some space in salesforce related to Chatter Files or Files, I though all records are stores in ContentDocument object, but when I delete records from this object, the file storage still ...
1
vote
2answers
85 views

Querying all the files from a list of groups for a particualr user

I'm trying to display all the files of all the Groups to which a user belongs to. i.e, if the user is a member of GroupA and GroupB, then I have to display all the files which belong to GroupA and ...
0
votes
1answer
140 views

Inconsistent ContentDocument Query Results

Using the Developer Console as System Admin: The result of this query: SELECT Id FROM ContentDocument does NOT contain the row returned from this query: SELECT Id FROM ContentDocument WHERE Id='...
2
votes
1answer
300 views

Getting Blob data from content document using File Sync

So im using File Sync to upload an excel file to salesforce in order to use it in other class ive built (the class is reading the csv file and insert the data to salesforce - that one works fine ...
1
vote
0answers
66 views

how to view a picture in a word document on offline mode VisualForce

I trying to access a picture in offline mode ( without a connection), stored in a word document which i generated with visualforce but it gives the following error. Can you please, tell me if it ...
0
votes
1answer
119 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 ...
1
vote
1answer
173 views

UserRecordAccess

Does UserRecordAccess report edit-ability of ContentDocument or ContentVersion records? Every user I query URA with for either object returns HasEditAccess=true even if the content is not shared ...
4
votes
2answers
835 views

Visualforce Pages in Object specific actions

I have a simple vf page that just calls a controller's method on the action attribute <apex:page standardController="C_Object__c" extensions="Ext1" action="{!method1}"> <apex:...
3
votes
1answer
865 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
1answer
70 views

I want to stop chatter emails when I create ContentDocumentLink

I'm uploading multiple files via the SOAP API in a nightly process. Part of that is assigning permissions to the files. I'm using ContentDocumentList to allow a user to see a document. When creating ...
5
votes
1answer
342 views

Is there a way in apex to add 'force.com Content' files as attachments in emails?

I need to develop a way for users to select what content they want from a custom page and then have it added as an attachment to an email. I know you can add attachments to emails via: http://www....
1
vote
1answer
2k 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 ...
4
votes
1answer
286 views

SOSL Filter by Library on Salesforce Content

Is is possible to search Salesforce Content in a specific library (ie. ContentWorkspace)? According to the Content data model, it seems the relationship between ContentWorkspace and ContentVersion ...
3
votes
1answer
1k views

SOQL query to load all documents in a content library

I am trying to query for all the documents in a library using the BULK API. The SOQL query I use is SELECT ContentDocument.Id,ContentDocument.CreatedDate,ContentDocument.LastModifiedDate,...
7
votes
1answer
1k views

Trigger to avoid file upload to chatter comment

We want to avoid, that a user is able to upload files to chatter comments. We realized this by creating triggers on FeedComment and ContentVersion. This prevents to save the comment successfully. If ...
1
vote
1answer
329 views

Return with Soql query “Related Content”

I'm trying to write a soql query to get all the content's ids of the related content on a custom object. I would like to know which are the related content of a record. I have tried with Schema ...
3
votes
1answer
851 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 ...
2
votes
1answer
861 views

How to delete latest version from ContentDocument?

Is there any way we can delete Latest Version from ContentDocument? I have tried deleting ContentVersion, but DML Operation Delete is not allowed on it. I have tried deleting ContentDocument, but it ...
11
votes
4answers
4k views

How can Document folder be created in unit tests?

Can Document folders be created in unit tests? If not, is there a simple workaround for testing Document objects in unit tests?
5
votes
1answer
534 views

ContentVersion Reasonchange not updateable?

I have a before update trigger that I want to use to capture updates to previous version records in the contentversion. I want to add additional text to the reasonchange that was added by the user ...
4
votes
2answers
5k views

how to show sharepoint documents in salesforce?

How to show sharepoint documents in salesforce? I should also be able to upload documents from salesforce directly to sharepoint if the users attach a document for a record in salesforce. Any idea ...
2
votes
3answers
1k views

Transfering content from one library to a new library

I attempting to move content from one library to another in mass. I have come into a snag where I am given an error message. "You do not have the level of access necessary to perform the operation ...
2
votes
1answer
486 views

Sharing documents with High volume portal users

My problem is similar to this but also with the added problem of security. High Volume Customer Portal user - Insufficient Privileges for non-image Documents I want only a certain group of people (...
11
votes
1answer
823 views

Obtaining all ContentDocument records using SOQL

According to the Salesforce documentation on ContentDocument Users (including users with the “View All Data” permission) can only query files they have access I find this very strange. Why would ...