The S-Doc Relationship Object

You can relate many records to the same S-Doc by leveraging the SDoc_Relationship__c junction object.

By default, one S-Doc record can be simultaneously related to up to 9 distinct standard Salesforce objects (Account, Asset, Case, Contact, Contract, Lead, Opportunity, Product and Solution). This can be easily expanded to more standard objects (e.g. Campaign) and custom objects by adding a lookup field to the SDoc_Relationship__c object. However, if a user wants to relate one S-Doc to multiple records of the same object type (e.g. one S-Docs Contract to two Salesforce Accounts), the user simply clicks on the New SDoc Relationship button from the S-Doc related list on the record and then relates it to the S-Doc. One additional SDoc_Relationship__c record is needed for each record of the same object type you want to relate to the same S-Doc.


The SDoc relationship junction object provides more power and flexibility in relating S-Docs to your Salesforce objects rather than just linking them directly. When a document is first generated, one S-Doc relationship record is automatically created and will be linked to up to two objects. This automated association is driven by the “Related to Type” and “Additional Relationship” fields on the template setup.

Note: If you don't see this field, simply modify your page layout for the SDoc Template object and add the Additional Relationships field.

The “Additional Relationship” field needs to be a related object field on the base object. For example, you can relate a document to an Opportunity and an Account (as an Additional Relationship) because there is an Account lookup field on the Opportunity record. Likewise, you can link an S-Docs to a Contact and the Account, since there is an Account lookup field on Contact. However, you could not, for example, automatically link an S-Docs to an Account (base object) and an Opportunity (Additional Relationship) because this is a one-to-many relationship.

You may also notice that the comments field and status field are conveniently located on the SDocs_Relationship object. S-Docs will automatically synchronize these fields among all relationships that point to the same generated document. For example, if you update the status of a Contract that is related to two different Accounts, the status will be consistent across all views.