The S-Docs User Guide

Introduction

This document will teach you how to generateemail, and edit documents in Salesforce Classic. You can also view the video tutorial below for using S-Docs with Salesforce Lightning.

This guide is intended for an end-user experience. To learn how to use the template editor, click here. For more information about how to leverage advanced S-Docs features to create high-quality templates, please refer to our Creating & Managing Templates, and Inserting & Formatting Data, and Applying Logic sections of the S-Docs knowledge base.

If you would like to review the setup and configuration of S-Docs, please refer to the S-Docs Quick Install & Config Guidewhich will teach you how to install S-Docs, create a template, add the S-Docs button to your object, and email a basic document.

Video Tutorial

Generating Documents

Navigate to an object that has been configured for S-Docs, and then go to any record you would like to generate documents for. In our example, we selected the "Contact" object, and we will generate documents for the Paul Allen Contact record. Once you get to your contact record, click the S-Docs button at the top of your page.


Now, select the templates you would like to use to generate documents for this contact. Then, click Next Step. In this example, we will be creating a golf invitation and an account summary for Paul Allen.


After clicking Next Step, the documents are generated and you are given a list of the generated documents. To download a document, find the name of the document you want to download under “Document Name” and click the Document Number to the left of it. To email documents, check the boxes of the documents that you would like to email and click Email Selected Docs. If you would like to add a comment to that document, find the name of the document you want to add a comment to under “Document Name” and click the Add button to the right of it.

In our example, we added a comment to our golf invitation, and we unchecked the account summary because we would like to email the golf invitation by itself. Note that we can click SD-100 to download the account summary document or SD-101 to download the golf invitation. We would like to email Paul Allen the golf invitation, so our next step is to click Email Selected Docs.


From here, you can proceed to the email page by clicking Email Selected Docs or you can click << Back to return to the page of the record you just used to generate documents.

Emailing S-Docs

Click Email Selected Docs to open the Email Documents page. Note that the docs you select are automatically included as attachments to the email. You can click the name of an attachment here and it will download to your computer. In our example, we see that Paul Allen’s golf invitation is included as an attachment.

Add Additional Attachments

If you would like to add more attachments to the email, click the Attach or Remove Files button. In the resulting pop-up, check one of the boxes under “Attach” to attach (or detach) a particular document to your email. Note that there are four tabs: the "S-Docs" tab contains all the documents ever generated for this record, the "Attachments" and "Files" tabs allow you to upload attachments and files from your computer, and the "Documents" tab allows you to attach files stored in the documents folder in your production org. The pop-up will close after each selection; click Attach or Remove Files again if you would like to attach (or detach) more files.

To choose recipients for your email, select an email address from the Contact Quick Pick drop-down menu, or search for a Contact’s email address in the Contact/User Lookup field. If you search for and select a Contact, their email address will be added to the "To" field, as well as the Contact Quick Pick list. Feel free to move these email addresses to CC or BCC, and type in a subject and a body as you would a normal email.

Alternatively, if you know the email addresses of the people you’d like to send the document(s) to, you can just type them into the To, CC, and BCC fields.

Email Failure Troubleshooting

By default, S-Docs links outbound emails to the contact record with a matching email address; Salesforce requires this linkage. If you try to send an email to an email address that is not listed under any Contact record in your org, S-Docs will attempt to link it to a single dummy contact record called "No Contact Record." This contact record is created automatically by the S-Docs package to handle this linkage, and is immediately deleted once the email is sent.

If your org has implemented validation rules that require additional contact fields to be completed, then the S-Docs package will not be able to create this contact record. In this case, there are two main options.

Option 1 (Recommended)

Create a before insert, before update Apex trigger on the Contact object that automatically changes the fields on the No Contact Record that S-Docs creates so that your validation rules are not triggered. For example, the trigger might look like this if your validation rules prevent the contact field "This_Cannot_Be_Null__c" from being null:

trigger ContactFirstName on Contact (before insert, before update) { 
  for (Contact c : trigger.new) { 
    if (c.LastName == 'No Contact Record') { 
      c.This_Cannot_Be_Null__c = 'some non-null value'; 
    } 
  } 
}

With this option, S-Docs will be able to create and delete the No Contact Record, and the email will be sent and logged in Activity History on the base object record.If you require test coverage for your No Contact trigger, you can use the following test class:

Class Name: NoContactTestClass

@isTest private class NoContactTestClass { @isTest 
  public static void noContactTest() { 
    Test.startTest(); Contact testContact = new Contact(); 
    testContact.LastName = 'No Contact Record'; 
    insert testContact; 
    Test.stopTest(); 
  }
}

Option 2Create the S-Docs No Contact Record manually with all of the fields filled in that are required by your validation rules. The fields that S-Docs requires should be filled in as follows:
First Name: Not Required. We recommend writing S-Docs to avoid confusion.
Last Name: No Contact Record
Email Address: this.email@is.invalid

You then need to add the following parameter to the end of your S-Docs button: useExistingNoContactRecord='true'

Example:

{!URLFOR('/apex/SDOC__SDCreate1', null,[id=Opportunity.Id, Object='Opportunity', useExistingNoContactRecord='true'])}

Note: This option is not recommended, as the email will not be logged in Activity History on the base object record.

Sandbox Deliverability

If you are testing S-Docs in a sandbox org and emails are not being delivered, you should check Setup > Email Administration > Deliverability, and check that "Access to Send Email" is set to "All email." By default, Salesforce turns off outbound email access when a sandbox is created to reduce the risk of inadvertently sending emails to contacts during development and testing. Be aware that this change affects the entire sandbox and not just S-Docs.

Here is how a completed email page might appear. Click Send to send the email.

Related Lists

After generating or emailing documents, you will return to the page for the record you just generated documents for.

During the configuration of S-Docs, you added an S-Docs related list to the objects that you wanted to use with S-Docs. The documents we just generated in our example are now in this related list. We can click the icons in the “View” or “Email” columns to download or email these documents.


Note that generating multiple documents with the same template for the same record will not result in these documents being overwritten; in our Paul Allen example, if we were to generate the golf invitation 10 more times, there would be 11 different golf invitation documents in the S-Docs table on the Paul Allen page. We could delete some of these by clicking Del under the Action column.

If Auto Create Salesforce Attachment and Link to Record is checked under Document Options in the template editor (it is checked by default), our generated document will be included in the "Notes & Attachments" related list. We can click View to download and view a document in this list.

Additionally, note that if the Auto Create Salesforce Attachment and Link to Record box is not checked, documents in the S-Docs related list will be regenerated each time they are opened. For example, if this box was not checked for an account summary template, and you opened an account summary document from 6 months ago, the document would be regenerated with the current account info rather than the account info from 6 months ago.

We see that this box is checked for the account summary template, but not the golf invitation template. Thus, only the account summary document appears in the "Notes & Attachments" related list.

Note: On older versions, this checkbox will appear on the S-Docs Template record detail page instead of in the template editor.



Note that the email we sent earlier is saved in the "Activity History" related list.

Opening it up shows the email details.


Editing Documents

Note that when we generated our documents for Paul Allen earlier, there was a pencil under the “Edit” column in the row containing the account summary document.

This pencil also appears next to the document in the S-Docs related list on the object record. We can click this pencil to edit the document that has just been created. Note that the pencil does not appear for the golf invitation document. This is because we have checked the Allow Edit box on the template detail page for the account summary template, but not for the golf invitation template.


Clicking this pencil opens an editor for that document. We can make any changes we want to the document, and click Save to save these changes.

user guide - 15
Note that even though our account summary document was generated as a PDF, a document that cannot normally be edited, S-Docs provides the power to allow editing at this step nonetheless.

Tags: , , ,

Was this helpful?