Triggers

The Folderize package includes some triggers on the Salesforce standard objects, ContentDocument and ContentVersion.  The triggers consume Salesforce resources (SOQL queries, DML statements etc.).  If your organization has custom code that manipulates these objects, you should keep in mind that the Folderize triggers will fire too.

The package also includes triggers on Folderize custom objects (sharem__SmDocument__c and sharem__SmDocumentFolder__c).  If you develop custom code to change the Folderize database, these triggers may fire.

Below are details on the resources consumed per firing of each trigger.

All these triggers support bulk operations.  They don’t consume much resources, except if you operate on multiple records one-by-one!  That may cause issues with Salesforce governor limits!

The amount of resources consumed also depends on configuration of the Folderize application.  The main setting that plays a role here is “Use Tags” in admin tools.  If ON, then triggers have more work to do to keep the Folderize database up-to-date.  (Many customers have this turned off.)  The information below describes resource consumption having this setting both on and off.

ContentDocument

There is one trigger for this object: ContentDocumentBgJobs.  The maximum resources it consumes is below.  “After Update” catches only updates to the IsArchived flag (when you archive or restore a document).  All other updates are ignored, and the trigger does not consume any resources.

Use Tags ON:

After update:
SOQL queries: 5
DML statements: 8

After delete:
SOQL queries: 1
DML statements: 1

After undelete:
SOQL queries: 4
DML statements: 7

Use Tags OFF:

After update:
SOQL queries: 1
DML statements: 1

After delete:
SOQL queries: 1
DML statements: 1

After undelete:
SOQL queries: 0
DML statements: 0

ContentVersion

There is one trigger for this object: ContentVersionBgJobs.  The maximum resources it consumes is below.  The “After Update” trigger fires on update of any field.

Use Tags ON:

After insert:
SOQL queries: 4
DML statements: 7

After update:
SOQL queries: 4
DML statements: 7

Use Tags OFF:

After insert:
SOQL queries: 1
DML statements: 2

After update:
SOQL queries: 1
DML statements: 2

sharem__SmDocument__c

There is one trigger for this object, SMF_SmDocBgJobs.  It consumes the following resources, except that this trigger does NOT consume any resources if the “Unlimited Documents” Folderize edition is activated.

Before insert:
SOQL queries: 1
DML statements: 0

sharem__SmDocumentFolder__c

There is one trigger for this object, SMF_SmDocFolderBgJobs.  It consumes the following resources only if the “Documents inherit folder sharing” setting is ON for your organization:

After insert:
SOQL queries: 1
DML statements: 2

After delete:
SOQL queries: 2
DML statements: 1