You are using an older browser that might negatively affect how this site is displayed. Please update to a modern browser to have a better experience. Sorry for the inconvenience!

S-Docs with Salesforce


By: Radha

Introduction: 

S-Docs is the Document Generator Application which we can get it from App-Exchange. It is specially Developed for the Salesforce platform. S-Docs works great with the both standard and custom objects and even in the Force.com platform edition, which contains of standard and custom objects. S-Docs can generate a variety of outputs that can combine Salesforce data from both standard and custom objects. Your documents may have many relationships to include data from formula fields, rich text, parent records, child, grandchild and related objects. Using the S-Docs template editor, we can design the final output that can have data generated from all these relationship fields. Finally, you can easily email your finished documents directly from salesforce and have the entire interaction captured seamlessly as an activity.

S-Docs doesn’t use traditional templates (e.g. existing MS Word or PDF files), but rather we can design our own template which contains all merged fields within Salesforce S-Docs Template records. Whenever a user generates a document, the S-Docs engine merges the template with your salesforce object record data and produces the merged document as an Output and it’s all happening within the force.com platform. There is no need to have a shared network drive, an external document repository, nor the need for connectors. Most importantly, you don’t need to log into any other system, or pass your data to any external servers. It is all self-contained in the force.com platform.

Advantages of S-Docs: 

  1. Data’s never leaves out of the Salesforce Platform.
  2. No External Web Services or Call outs.
  3. Works natively with the existing Salesforce Technologies.
  4. Point-and-click template editor is designed for non-programmers; No Visualforce, Apex coding or deployments needed.
  5. Automate the entire process without any code using Salesforce workflow or Process Builder.
  6. Include rich text, static or dynamic images such as graphs and charts

The following are the Steps to Create the S-Docs Templates:

STEP 1: Install the S-Docs.

  1. In App-exchange, click the “Get It Now” button from the S-Docs and agree to the terms and conditions.
  1. Next, we should log into our test (or) developer org using an administrator account. from the package detail screen, click “Continue”.
  1. During the two-step package installer process, we will click next and accept all the defaults. Optionally, we can grant access to more than the admin group during step 2. During Step 3, leave the “Ignore Apex test failures.” checkbox unchecked. Then click install.
  1. Once we got the install Complete Screen, then click the “View package Contents”. which is shown below:

 

To complete the install, we need to click the “Deploy”.

We have installed the S-Docs in our Org.

STEP 2: Creating our first template

We can select the “S-Docs Template Object” in the All tab selection

In this example, we will create the Account detail report for the Account Object. In S-Docs Template Object Click the “new” button and enter the field Values as below. Once the values are entered, click the “Save” button.

 

 

Let’s see the field descriptions:

  1. Name: Give the name for template (Required).
  2. Description: You can give any Keyword in the description field for user understanding (optional).
  3. Document Category: select the Category of the document. User can group the document using Category picklist. If needed, we can Customize it (optional).
  4. Related to Type: Select the Object which is going to use as a primary Object from the picklist. If needed, we can Customize it (optional).
  5. Additional Relationships: We can leave this field as blank.
  6. Output Format: Select the Output format from the picklist. if needed, by cloning the template, we can use the single documents in multiple formats.
  7. Document Version: we can use this field for our references by giving name or numbers.
  8. Available for Use: If we check this box, it will visible for new document creations.
  9. Initially Visible: If we checked this box, it will make this template visible on initial load of document creation page based on the Object Type.
  10. Auto Create Attachment: If we checked this box, an attachment will create for each document using this template. It may consume more file storage(Optional).
  11. Enable Detail Reports: If we checked this box, a child record will be created for each field value in every document using this template, and it may consume more file storage (Optional).

By Clicking, the “Template editor” button, we can design our template.

 

Give some text (Label), click the “Insert field” button, and then select the salesforce record data to be merged into the template.

 

Select the field from the object you want to “insert”. Then, the editor will add the merge field in the correct syntax into the template.

 

We can continue the above steps for creating other fields and also use the editor tool for modifying the document. Click the “source” to modify the Html in your own style.Click “save”  when finished.

NOTE: You can also insert images, span related objects and create child object line items and add css stylesheets.

STEP 3: Add the S-Docs button to your object’s page layout

You will need to add a custom button. In this example, we would go to Setup–>Customize–> Products > Buttons and Links.

Then click “New”. You should modify the button link to your object. In this case, we used:

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

Once you save the button, you will need to add it to the detail page layout by opening the layout editor, dragging the S-Docs button into the Custom Button area,  and then clicking “Save”.