function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
NiketNiket 

Issue with ContentFolder

I am trying to create folder inside content library. Though, it is mentioned here (https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_contentfolder.htm" target="_blank) that I can do that, but when I am trying to set library id as ParentContentFolderId, I am getting error 

FIELD_INTEGRITY_EXCEPTION, Parent Content Folder ID: id value of incorrect type: 058M00000009eY0IAI: [ParentContentFolderId]

Here 058M00000009eY0IAI is the id of existing library. 

Have anyone implemented this yet ? I appreciate any help.
pconpcon
I'm trying to get these objects to even show up in my Development org so I can look at the metadata for you at see why it would be throwing that exception.  How did you get them enabled?  Are you able to setup this metadata describe app [1] on a sandbox or an environment where you can use it to look at both the ContentFolder object and the Library object.  The metadata describe app will tell you the types that the ParentContentFolderId can be.  Additionally if you expand the Description section when looking at the Library object you can see the prefix of that Id.  For me (and it should be the same for you) the prefix for the Library object is 058.  So that means that the ParentContentFolderId does not a lookup to the Library object.

[1] https://developer.salesforce.com/blogs/developer-relations/2015/02/using-metadata-api-describe-objects.html