Find your content:

Search form

You are here

Developer org needs Salesforce Content License


I'm trying to insert a ContentVersion item as follows:

string before = 'Testing base 64 encode';
Blob beforeblob = Blob.valueOf(before);
ContentVersion v = new ContentVersion(Title='New Document',VersionData=beforeblob);
insert v;

But I'm getting the error:

System.DmlException: Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, To create records with origin "C", Salesforce Content must be enabled in your organization and the Salesforce Content feature license must be enabled for your user. 

I tried this a Enterprise/Platform Org and a Platform Developer Org

Where do I enable this license for development in my org?

Attribution to: jordan.baucke

Possible Suggestion/Solution #1

Is Salesforce Content Enabled?

App Setup > Customize > Salesforce CRM Content > Settings > Enable Salesforce CRM Content?

If so, does the user that is running this code have Salesforce CRM Content enabled on their user profile?

Screen Shot (cause I've got no rep!!)

A good resource for additional documentation is

Attribution to: Mikey
This content is remixed from stackoverflow or stackexchange. Please visit

My Block Status

My Block Content