You need to sign in to do that
Don't have an account?
Jason Kelley
Is it possible to insert list of ContentDistribution records?
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.
Jason Kelley
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.