I have a ContentDistributionTrigger trigger after insert & update which when fired has a null value for ContentDownloadUrl.

The ContentDistribution is created in a ContentDocumentLinkTrigger as such:

ContentDistribution cd = new ContentDistribution();
cd.Name = (String)link.LinkedEntityId + ' logo' ;
cd.ContentVersionId = // my id
cd.RelatedRecordId = link.LinkedEntityId;
cd.PreferencesAllowOriginalDownload = true;
cd.PreferencesPasswordRequired = false;
insert cd;

Then in my ContentDistributionTrigger:

trigger ContentDistributionTrigger on ContentDistribution ( after insert, after update ) {

    for (ContentDistribution cd : Trigger.new) {

debugs as "null"

Is the ContentDownloadUrl generated after the after insert trigger fires? If so, why don't I catch it in the "after update" run of this trigger?

Thank you,


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.