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:
- Data’s never leaves out of the Salesforce Platform.
- No External Web Services or Call outs.
- Works natively with the existing Salesforce Technologies.
- Point-and-click template editor is designed for non-programmers; No Visualforce, Apex coding or deployments needed.
- Automate the entire process without any code using Salesforce workflow or Process Builder.
- 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.
- In App-exchange, click the “Get It Now” button from the S-Docs and agree to the terms and conditions.
- Next, we should log into our test (or) developer org using an administrator account. from the package detail screen, click “Continue”.
- 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.
- 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:
- Name: Give the name for template (Required).
- Description: You can give any Keyword in the description field for user understanding (optional).
- Document Category: select the Category of the document. User can group the document using Category picklist. If needed, we can Customize it (optional).
- 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).
- Additional Relationships: We can leave this field as blank.
- Output Format: Select the Output format from the picklist. if needed, by cloning the template, we can use the single documents in multiple formats.
- Document Version: we can use this field for our references by giving name or numbers.
- Available for Use: If we check this box, it will visible for new document creations.
- 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.
- 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).
- 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:
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”.