The following guide discusses how to use S-Docs in Lightning and how to edit a template in Lightning.

Adding an S-Docs Button to an Object's Page Layout in Lightning

If you have not already created an S-Docs button for your page layout, you will need to add a custom button. (Note that the S-Docs button comes prepackaged for many standard objects, such as Opportunities, Contacts, and Accounts.) To create a new button, you'll need to go to Setup>Customize>YourObjectNameHere>Buttons, Links & Actions.
You can then click on “New” and fill in the fields as in the following screenshot. You'll need to modify the button link per your object. In this case, our object is a Product (API name Product2), so we used:

/apex/SDOC__SDCreate1?id={!Product2.Id}&Object=Product2


Then, you'll have to add your new button to your page layout. In Lightning, you will be selecting the button from the "Salesforce1 & Lightning Actions" box in the toolbar and adding it to the Salesforce1 and Lightning Experience Actions" box in the page layout.


Click "Save", and you're all set! You can now generate S-Docs in Lightning.

Using S-Docs in Salesforce Lightning

To generate an S-Doc for a record, go to that record’s page and click the “S-Docs” button:

using-s-docs-in-lightning-1
Then, select the templates you would like to use. Click “Next Step” to generate documents derived from the templates you selected:

using-s-docs-in-lightning-2

Once you have generated your documents, you will see the “View Document(s)” page.

using-s-docs-in-lightning-3

Please take note of the “Add” buttons under the “Comments” column, the pencil icon under the “Edit” column (if available), the “Email Selected Docs” button, and the document icons under the “View” column. You can click “Add” under the “Comments” column to add a comment to that S-Doc; this will appear later on in the S-Docs related list. Additionally, you can click one of the icons under the “View” column to view that document in a new tab:

using-s-docs-in-lightning-4

Let’s return to the “View Document(s)” page. If “Allow Edit” is enabled for a particular template, you can click the pencil icon corresponding to that document to edit it after it’s been generated:

using-s-docs-in-lightning-5

After you make your edits, you can click “Preview” to preview the final document, “Save” to save and return to the “View Document(s)” page, and “Close” to discard your changes and return to the “View Document(s)” page.

On the “View Document(s)” page, you can click “Email Selected Docs” to email your documents. Your documents will be included as attachments on an email. Here, you can edit the email fields as desired and click “Send” to send your email or “Cancel” to return to your record’s page.

using-s-docs-in-lightning-6

Once you return to your record’s page, you will notice that the S-Docs you generated now appear in the S-Docs related list. You can click “View All” for a more in-depth look at your S-Docs’ details.

using-s-docs-in-lightning-7

On the following page, you can click the document icon in the “View” column, the mail icon in the “Email” column, or the pencil icon in the “Edit” column to respectively view, email, or edit the corresponding document.

using-s-docs-in-lightning-8

Now, going back to the record we generated S-Docs for, if we scroll down to the bottom of the page, we will see that the email we sent was recorded in the “Past Activity” section. Additionally, the Opportunity Summary was saved in the Notes & Attachments section, but not the Invoice. This is because “Auto-Create Attachment” is enabled for the Opportunity Summary template but not the Invoice template.

using-s-docs-in-lightning-9

(If you’re a normal S-Docs user who is just generating documents and not editing templates, you can ignore the following note)
Note. In the S-Docs related list and “View Document(s)” page, the pencil icon will not show up for S-Docs that do not have “Allow Edit” enabled. Additionally, note that if the auto-create attachment box is not checked on a template, the documents created with that template in the S-Docs related list will be regenerated each time they are viewed, emailed, or edited. 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 and the current account info would be displayed, rather than the account info from 6 months ago. These fields can be found on the record page for that particular S-Docs template, as shown in the upcoming section “Editing S-Docs Templates in Salesforce Lightning”:

using-s-docs-in-lightning-10

 

Editing S-Docs Templates in Salesforce Lightning

Editing templates in Lightning works just the same as Classic. The only difference is getting there! To get there, go to the App Launcher and select the S-Docs app.

editing-templates-in-lightning-1

Then, click the “S-Docs Templates” tab. From here, you can select any template you’d like to edit.

editing-templates-in-lightning-2

Once you select a template, you can edit its fields or head over to the template editor to edit the contents of the template itself.

editing-templates-in-lightning-3

And there it is! Editing your template in Lightning works exactly the same as editing your template in Classic. If you wish to learn more about editing S-Docs templates, please see the S-Docs Developer's Guide.

editing-templates-in-lightning-4