Hot answers tagged

18

the solution is to add your keySet() from Map to a new Set() and use that in the query filter using IN: Ex: Set<Id> newSet = mapOfContentVersion.keySet(); [SELECT ContentDocumentID, LinkedEntity.type, LinkedEntityId FROM ContentDocumentLink WHERE ContentDocumentID IN: newSet ] ...


13

Short Answer Yes it does count! How did I find out? I can't find any specific information regarding the storage, but given that the limits are in place to control a multi-tenant system, and that you can retrieve archived content (as per the docs) it would be reasonable to expect that it does count. I just performed a simple test in one of my developer ...


12

The idea thread mentioned by @crmprogdev is now realized. As of winter 15 there is now programmatic access to content deliveries. ContentDistribution cd = new ContentDistribution(); cd.name = 'test'; cd.ContentVersionId = '12312132abad'; cd.PreferencesAllowOriginalDownload = false; cd.PreferencesAllowPDFDownload = false; cd.PreferencesAllowViewInBrowser = ...


10

You can directly download using the ContentVersion Id: /sfc/servlet.shepherd/version/download/<CONTENT VERSION ID starting with 068> The ContentVersion is related to the ContentDocument via a dedicated ContentDocumentId. Get the ID of the one where IsLatest is true.


9

As you mention ContentVersion is not updatable (versions are explicitly immutable, a feature of the content product), you would have to stage the blob somewhere else (perhaps an attachment) until its complete, then create the contentVersion record.


7

Looking at the limit doc, the limit applies to any Content Documents and Versions, so that would include new docs, updates, everything. It also says that the limit is 'adjustable', so try calling Salesforce and asking for it to be increased.


7

You are correct. You will have to rely on existing metadata to complete your tests. You can still create documents and put them existing library's. One thing I did in my tests for a similar implementation is to ensure that after every SQL I check to see if the list was empty. If it was I set a variable to a useful error message. Then I system.assertEquals('...


6

Update: There isn't currently an object exposed with the ContentWorkspace Member details as configured against the Library. Screenshot of the Members section from the UI: I believe a SOQL query against ContentWorkspace will only return records that the current user has access to. However, this won't indicate the level of access. Consider promoting the ...


6

Your URI is invalid according to RFC 3986: the fragment part (the "#search") should come after the query part (the "?searchTerm..."). If you fix that, the PageReference will correctly parse the query terms rather than throwing them away. Its a pity PageReference silently discards the query terms rather than throwing an exception. (You can confirm this by ...


6

You might be able to use the OAuth accessToken in a cookie with the HTTP GET request to servlet/rtaImage depending on the scope you requested when getting it. I believe you will need to use the full or web scopes to then make web requests or use frontdoor.jsp. See: Scope Parameter Values Use OAuth 2.0 Tokens to login to Salesforce.com The cookie will ...


5

The following worked for me: ID workspaceId = [SELECT Id FROM ContentWorkspace WHERE Name = 'EMEA Sales'][0].Id; List <ContentVersion> allDocuments = [SELECT Title FROM ContentVersion WHERE ContentDocument.ParentId = :workspaceId]);


5

According to this post, the answer to your question about using content packs would be "no". On the IdeaExchange you'll find a submission titled Allow Content Deliveries to be programmatically generated via Apex which has some related links on it you may also want to look at. Regardless, I believe this "idea" covers the gist of your question. It seems to ...


5

We needed these content to be exported urgently. So, couldn't tried any AppExchange App. Every salesforce content has it's download URL like : http://Your_ORG_URL/sfc/servlet.shepherd/version/download/?asPdf=false" We logged into one browser and wrote a automation script to download these files by it's URL. It was quite fast.


4

ContentDocumentLink is not the only way to get the ID of this file. You can run the following query to get the ids of all the contentversion records: Select RelatedRecordId, ID From FeedItem where Type = 'ContentPost' Then you can run a query on the contentversion and related contentdocument to get all the information you need. Select Title, ContentUrl, ...


4

You can query the Contentversion to get the files posted on the Object. But before you can do this, you must make sure the files are shared to your API user or to the company. This is because the access control of ContentVersion is a little different with others. see doc, http://www.salesforce.com/us/developer/docs/api/Content/...


4

There doesn't appear to be any exposed object that will show you the relationship between the Content Pack ContentVersion and the member ContentVersion records. As you have found, you can find the ContentVersion record based on the FileType being 'PACK'. You can also see the ContentVersion records that make up the pack. But there is currently no way to see ...


4

ContentVersion can not be the parent of any custom object. ContentVersion can be the child, via a lookup relationship to Custom or Standard objects. This is done by Setup | Customize | Salesforce CRM Content | Fields | New Historically, ContentVersion and its related objects ContentWorkspace, ContentDocument etc. were acquired through an acquisition and ...


4

This must be a recent update (this year), because I had code working filtering on a Set with no problem, and suddenly noticed today it no longer worked. I resolved the issue by first casting the Set to a List; see below. // Get content document links List<ContentDocumentLink> contentDocLinks = [ SELECT ContentDocumentId ...


4

It appears that Content is available in all editions. However, it may not be enabled in some orgs. Therefore, your "pre-installation instructions" will need to include the need to go to Setup and enable this feature. Your package will not be able to install until this feature is enabled.


4

Hope you have gone through these differences before posting the question. Refer Differences Between Files, Salesforce CRM Content, Salesforce Knowledge, Documents, and Attachments CRM Content needs separate licenses (Salesforce CRM Content User) where as using files do not need separate licenses. CRM Content gives much more security and flexibility which ...


4

I'm still trying to figure this out myself, but I believe what you are looking for is the DistributionPublicUrl field on the ContentDistribution object. I think the query would be something like: select DistributionPublicUrl from ContentDistribution where ContentDocumentId = :file.ContentDocumentId It looks like the ContentDistribution record is what gets ...


3

As you've found, I don't think you can update the featured status outside the UI as you can't toggle the FeaturedContentBoost between 0 and 1 due to its Read Only status. The FeaturedContentDate doesn't help as it appears to be set internally based on changes to the former field. If you were really keen and willing to take the risks associated with using ...


3

The prior answer is correct, a workflow or trigger would be the usual way to do this. Unfortunately Content does not support workflow yet, but did recently add support for triggers on a couple of the content objects. The Content data model is a little funky at first. It'll help to review the Content ERD in the Webservices API Docs. If you're only looking ...


3

You can query the ContentWorkspace standard object from Apex. I just created a library in my DE org, then, from the Developer Console, executed List<ContentWorkspace> cwl = [select Id, Name, Description from ContentWorkspace]; for (ContentWorkspace cw : cwl) { System.debug(cw); } This gives me 10:41:02:058 USER_DEBUG [3]|DEBUG|ContentWorkspace:{...


3

From the ContentWorkspace docs: Special Access Rules Customer and Partner Portal users can only edit the library document object if they have a Salesforce CRM Content feature license. Customer and Partner Portal users can query this object if they have the “View Content in Portal” permission. A user can query all public libraries where they ...


3

Yes this is possible with a nested SOQL query. The trick is to use the "Child Relationship Name" of the related object. You set this name when creating the lookup from the child to the parent object. So if the parent object is Parent__c and the child is Child__c, and in the lookup from child to parent, you set the Child Relationship Name to "Children", your ...


3

Retrieving documents from a library using filter like [SELECT Title FROM ContentVersion WHERE ContentDocument.ParentId = :workspaceId] may be incorrect, if document is shared with several libraries, and workspaceId is not equal to the library it was initially uploaded to. Example: Doc1 was uploaded in Library1, and then shared with Libary2. If you use ...


3

The answer depends on the type of content you want to put in your folders... Code. Files representing code on the Salesforce.com platform are represented in a mostly flat, folderless structure. In order to represent them on your local disc for development and storage in source control, there is a basic folder structure to categorise, Apex code, Visualforce ...


3

Okay, a week later I have the answer. With SOQL you can get them all with SELECT Id, Name FROM TagDefinition. Then for each standard object you have a separate table linking records to tags, e.g. AccountTag. Custom objects have their own ObjectName__tag object type which can be queried.


3

The display options are predefined, you cannot add custom fields unfortunately. Vote it up : https://success.salesforce.com/ideaview?id=08730000000BqFvAAK


Only top voted, non community-wiki answers of a minimum length are eligible