...
If automated Container creation is not required, the T4S Admin pages will allow a Salesforce Admin to create multiple Content Manager Containers from a button click.
When an sObject has been configured in the T4S Admin, an ordered list is displayed where records without a Container can be selected to have a Container created. Or a record with a mapped Container can be re-mapped to a different Container.
It is also possible to have a Content Manager Container created from a button click on a Salesforce page.
When you set up the T4S Settings for a sObject or custom object, you can select the “Enable Sub Container“ checkbox, and then use this boolean value within your custom code to decide if a new Container should be created or not when a new Salesforce record is inserted.
...
The “Trim sObject Container Uri“ field tells T4S where the new Container should be created.
This can be overridden by adding the specification property “RecordContainer“ and value, with the Container Specification Property Set.
This again can be overridden if you have requirements to create separate Container Specification Property Sets for each Salesforce Record Type for the configured sObject.
NOTE: Within the example code below there is a method to syncrhonise Account files.
T4S installs a default scheduler that when run will transfer all waiting Salesforce Files & Attachments to Content Manager no matter which Salesforce sObject the waiting files belong to.
Automated Container Example Code:
Create a trigger or update an existing trigger for the sObject that you would like a Container created for on each insert or update.
...