Skip to main content

I'm trying to create groups of ContentDistribution records via Apex.  Unfortunately, when inserting them, I'm getting the following error:

System.DmlException: Insert failed. First exception on row 0; first error: DUPLICATE_VALUE, duplicate value found: <unknown> duplicates value on record with id: <unknown>:

Here are the two records trying to insert:

ContentDistribution:{Name=test0, ContentVersionId=068m00000009X4zAAE, PreferencesAllowOriginalDownload=true, PreferencesAllowPDFDownload=true, PreferencesAllowViewInBrowser=true, ExpiryDate=2015-07-31 00:00:00, PreferencesExpires=true, RelatedRecordId=a4S60000000L1cgEAC}

ContentDistribution:{Name=test1, ContentVersionId=068m00000009X4zAAE, PreferencesAllowOriginalDownload=true, PreferencesAllowPDFDownload=true, PreferencesAllowViewInBrowser=true, ExpiryDate=2015-07-26 00:00:00, PreferencesExpires=true, RelatedRecordId=a4S60000000KztXEAS}

The only duplicate value between the two is the ContentVersionID, which I assume should be fine. 

 
1 risposta
  1. 21 lug 2015, 18:16
    Apparently the ContentVersionId cannot be the same.  Through the UI, you can create as many Content Deliveries for a single Content Version as you like. 
0/9000