How to make ContentVersion public using Apex The Next CEO of Stack Overflow2019 Community Moderator ElectionHow to upload an Excel file into ContentVersion Objecthow to make field ready only..?Custom field on ContentVersion returning 'NULL' in SOQL even value is assigned into the custom fieldApex Query on ContentVersion object and get all recordHow to make a Public REST API in apex without user name/Password but using authToken in apex class?Insert base64 string as attachment using apex dataloaderno preview for ContentVersion when inserting from ApexContentDocumentID is not available just after ContentVersion getting inserted But available after soql queryHow to convert ContentVersion VersionData to StringInsert ContentVersion without VisualForce
Simplify trigonometric expression using trigonometric identities
Can you teleport closer to a creature you are Frightened of?
How to show a landlord what we have in savings?
How exploitable/balanced is this homebrew spell: Spell Permanency?
How do I secure a TV wall mount?
My ex-girlfriend uses my Apple ID to login to her iPad, do I have to give her my Apple ID password to reset it?
What difference does it make matching a word with/without a trailing whitespace?
The sum of any ten consecutive numbers from a fibonacci sequence is divisible by 11
Traveling with my 5 year old daughter (as the father) without the mother from Germany to Mexico
Read/write a pipe-delimited file line by line with some simple text manipulation
Horror film about a man brought out of cryogenic suspension without a soul, around 1990
Why do we say “un seul M” and not “une seule M” even though M is a “consonne”?
Avoiding the "not like other girls" trope?
What is the difference between 'contrib' and 'non-free' packages repositories?
What are the unusually-enlarged wing sections on this P-38 Lightning?
Variance of Monte Carlo integration with importance sampling
Man transported from Alternate World into ours by a Neutrino Detector
Is there a rule of thumb for determining the amount one should accept for of a settlement offer?
How to find if SQL server backup is encrypted with TDE without restoring the backup
Noise during hard braking
What did the word "leisure" mean in late 18th Century usage?
Is it correct to say moon starry nights?
How do I keep Mac Emacs from trapping M-`?
What happens if you break a law in another country outside of that country?
How to make ContentVersion public using Apex
The Next CEO of Stack Overflow2019 Community Moderator ElectionHow to upload an Excel file into ContentVersion Objecthow to make field ready only..?Custom field on ContentVersion returning 'NULL' in SOQL even value is assigned into the custom fieldApex Query on ContentVersion object and get all recordHow to make a Public REST API in apex without user name/Password but using authToken in apex class?Insert base64 string as attachment using apex dataloaderno preview for ContentVersion when inserting from ApexContentDocumentID is not available just after ContentVersion getting inserted But available after soql queryHow to convert ContentVersion VersionData to StringInsert ContentVersion without VisualForce
I want to make a ContentVersion record publicly available using Apex.
I know I can get the DistributionPublicUrl value from the ContentDistribution object.
But I don't know how I should configure the ContentVersion so that the DistributionPublicUrl is generated?
apex contentversion
add a comment |
I want to make a ContentVersion record publicly available using Apex.
I know I can get the DistributionPublicUrl value from the ContentDistribution object.
But I don't know how I should configure the ContentVersion so that the DistributionPublicUrl is generated?
apex contentversion
add a comment |
I want to make a ContentVersion record publicly available using Apex.
I know I can get the DistributionPublicUrl value from the ContentDistribution object.
But I don't know how I should configure the ContentVersion so that the DistributionPublicUrl is generated?
apex contentversion
I want to make a ContentVersion record publicly available using Apex.
I know I can get the DistributionPublicUrl value from the ContentDistribution object.
But I don't know how I should configure the ContentVersion so that the DistributionPublicUrl is generated?
apex contentversion
apex contentversion
asked 5 hours ago
RobsRobs
2,361638
2,361638
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Just create an instance of ContentDistribution by providing you ContentVersion and a Name and then query the DistributionPublicUrl.
ContentDistribution cdl = new ContentDistribution();
cdl.ContentVersionId = '0680DXXX002RmxQAE';
cdl.Name = 'PublicShare';
insert cdl;
cdl = [SELECT DistributionPublicUrl FROM ContentDistribution WHERE Id = :cdl.Id LIMIT 1];
return cdl.DistributionPublicUrl;
Reference:
- SOAP API Developer Guide: ContentDistribution
add a comment |
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "459"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f256085%2fhow-to-make-contentversion-public-using-apex%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Just create an instance of ContentDistribution by providing you ContentVersion and a Name and then query the DistributionPublicUrl.
ContentDistribution cdl = new ContentDistribution();
cdl.ContentVersionId = '0680DXXX002RmxQAE';
cdl.Name = 'PublicShare';
insert cdl;
cdl = [SELECT DistributionPublicUrl FROM ContentDistribution WHERE Id = :cdl.Id LIMIT 1];
return cdl.DistributionPublicUrl;
Reference:
- SOAP API Developer Guide: ContentDistribution
add a comment |
Just create an instance of ContentDistribution by providing you ContentVersion and a Name and then query the DistributionPublicUrl.
ContentDistribution cdl = new ContentDistribution();
cdl.ContentVersionId = '0680DXXX002RmxQAE';
cdl.Name = 'PublicShare';
insert cdl;
cdl = [SELECT DistributionPublicUrl FROM ContentDistribution WHERE Id = :cdl.Id LIMIT 1];
return cdl.DistributionPublicUrl;
Reference:
- SOAP API Developer Guide: ContentDistribution
add a comment |
Just create an instance of ContentDistribution by providing you ContentVersion and a Name and then query the DistributionPublicUrl.
ContentDistribution cdl = new ContentDistribution();
cdl.ContentVersionId = '0680DXXX002RmxQAE';
cdl.Name = 'PublicShare';
insert cdl;
cdl = [SELECT DistributionPublicUrl FROM ContentDistribution WHERE Id = :cdl.Id LIMIT 1];
return cdl.DistributionPublicUrl;
Reference:
- SOAP API Developer Guide: ContentDistribution
Just create an instance of ContentDistribution by providing you ContentVersion and a Name and then query the DistributionPublicUrl.
ContentDistribution cdl = new ContentDistribution();
cdl.ContentVersionId = '0680DXXX002RmxQAE';
cdl.Name = 'PublicShare';
insert cdl;
cdl = [SELECT DistributionPublicUrl FROM ContentDistribution WHERE Id = :cdl.Id LIMIT 1];
return cdl.DistributionPublicUrl;
Reference:
- SOAP API Developer Guide: ContentDistribution
edited 2 hours ago
Robs
2,361638
2,361638
answered 5 hours ago
Pranay JaiswalPranay Jaiswal
18.3k43058
18.3k43058
add a comment |
add a comment |
Thanks for contributing an answer to Salesforce Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f256085%2fhow-to-make-contentversion-public-using-apex%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
