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
rohits83rohits83 

Sample SOAP Message for Content Folder

Hi

 

I need to push a document in Content Folder in a workspace. I'm creating the below SOAP message but I'm nolt able to push the document using the below mentioned SOAP request message.

 

<urn:create>
<urn:sObjects xsi:type="ContentWorkspaceDoc">
<ContentDocument>
<Title>Title for Document</Title>
<LatestPublishedVersion>
<VersionData>getBinaryData()</VersionData>
</LatestPublishedVersion>
</ContentDocument>
<ContentWorkspace>
<Name>Name of the workspace</Name>
</ContentWorkspace>
</urn:sObjects>
</urn:create>

 

 

SuperfellSuperfell
IIRC, You need to create a ContentVersion object, not a ContentWorkspaceDoc object, the CWD is just the join/membership table.
crop1645crop1645

Some further tips if you use workspaces and custom fields on your Content record...

 
1. Insert ContentVersion

2. Insert ContentWorkspaceDoc (this associates the ContentDocument to the ContentWorkspace; you'll need the ContentVersion.ContentDocumentId to do this which requires a Select on what you just inserted)

3. Update ContentVersion with any custom fields - custom fields can't be added on the initial insertion call
 

If you think about it, this mirrors the Content UI - first the document is uploaded, then you associate to a workspace and then you get a chance to enter custom fields, if you use them.

 

 

 

Message Edited by crop1645 on 12-08-2009 03:27 PM
rohits83rohits83
Thanks a lot for your inputs !!!
crop1645crop1645

Followup:

 

tags also can't be added as part of the Insert ContentVersion record. You also need to add the tags on an DML Update call. (step 3 above)