Hot answers tagged

21

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

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.


8

I encountered the same error in my query for ContentDocumentLink records: "Implementation restriction: ContentDocumentLink requires a filter by a single Id on ContentDocumentId or LinkedEntityId using the equals operator or multiple Id's using the IN operator." But the issue turned out to be that my Set was empty. The error message was misleading. I ...


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('...


7

In addition to @harish answer, the underlying problem is similar to using object.field notation as bind variables in dynamic SOQL - even though the use case is static SOQL For static SOQL - does not work [select COUNT() from ContentDocumentLink where LinkedEntityId = :someObj.Id] For static SOQL, does work ID filter = someObj.ID; [select COUNT() from ...


7

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 ...


7

Files uploaded via this related list will only be visible to internal users, and this field is not editable. One thing you can do is post the file to the record via the Chatter publisher, and specify the visibility in your post. This would give the attached file the same visibility as the post. Another option is to write a trigger and edit the Visibility ...


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 ...


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 ...


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.


5

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 ...


4

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 ...


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

No, it's not possible in SFMC. There are several ways to approach this. The best way I've seen is to break up the email components into Content Areas. You could do something like this: Upload all of the background images you'd want to use to the Portfolio and record the URLs of each Create a HTML-only Content Area for each background. Make the Name and ...


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

You can programmatically create a public link from a ContentVersionId and then get the download URL like this: ContentDistribution publicLink = new ContentDistribution(ContentVersionId = myContentVersionId, Name='External Link', PreferencesNotifyOnVisit = false); insert publicLink; publicLink = [SELECT ContentDownloadUrl, ContentDocumentId ...


3

I figured it out.... I had some empty columns hiding behind other columns that I didn't notice. The following link showed me how to find and remove them. I was then able to continue on with my load. http://www.extendoffice.com/documents/excel/823-excel-delete-multiple-empty-columns.html


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


3

you can try FileExporter app from appexchange.


3

I see you are using Viusalforce and I feel you are messing with Session ID .I tested below code and works in my org <apex:page standardController="Case"> <p> Select a file to upload. </p> <input type="file" id="file" onchange="upload()"/> <p id="message"></p> <script src="{!$Resource.forcetk}"></script> &...


3

First of all, from the screenshot you provided it looks like you are looking for Salesforce for Non-profit organization (free first 10 licenses and discounted after). In regard of your questions 1&2, I believe CRM Content and Content Libraries are the same and do not require additional license, however, depending on edition you will use, you might not ...


3

What you're trying to do is called a semi-join (or an anti-join if you use NOT IN). These are useful for gathering table A if it contains or does not contain some relational object (e.g. find all accounts with a contact named Bob). SELECT Id,Name FROM Account WHERE Id IN (SELECT AccountId FROM Contact WHERE FirstName = 'Bob') A sub-query is slightly ...


3

For Salesforce Classic Step 1: In quick find box search for salesforce file Step 2: click on Field, you will be directed to this page Create your Custom Field..!!


3

Salesforce support confirmed that at present there is no option to programmatically regenerate the previews. I was able to generate a Selenium script that iterated through all of my contentversionids and submit each one individually using the "Regenerate a Content or File Preview" page.


3

It's ContentVersionRating object revealed by Salesforce in latest version 42.0. ContentVersionRating Represents a rating on a version of a file. This object is available in API version 42.0 and later. Just verified- I liked a content and queried in dev console as below and it returned result: select id, Rating, ContentVersion.title from ...


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