S-Docs Quick Introduction

17.04.2019
|
0 Comments
||
|

A Quick reference to S-Docs

S-Docs is a tool to create documents for the user in salesforce. It is simple, smart, fast and secure document generator built for salesforce platform.

S-Docs allows you to generate a variety of outputs that can merge Salesforce data from both standard and custom objects. One can include data from formula fields, rich text, parent records, child, grandchild and related objects all within the same document.
To call S-docs service on click of a button, use the URL below:

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

where myObject__c is a custom object.

Similarly, one can call standard object also.

Below are some features of S-Docs that can be helpful while creating pdf files inside salesforce:
1. Link many objects to one document : This can be done by adding a
lookup field to the SDoc_Relationship__c object.
2. Saving S-Docs as attachments. Below is the setting in Template Editor that is needed:

3. Use your own stylesheet or CSS Solution. Go to the template editor, then click on the “Source” button.. You can then copy your own tags at the start of the page

4. Change page size and orientation : By adding @page annotation in style tag.
Ex –

<style>
@page
{
 /* use landscape orientation */
size: landscape;
}
    </style>

It can also be set by using page settings option available in S-Docs Template as shown below screenshot:

Embedding static images into your document: For static images, like a company logo, you can simply use an image tag similar to the following in your S-Docs template source.

<image src=”http://publicsite/imagename.png” />

5. Add related lists or line items to your documents : Below is the syntax

<!--{{! <LineItems>
<class>style8</class>
<ListName>OpportunityLineItems</ListName>
<column>PriceBookEntry.product2.Name</column>
<column>PriceBookEntry.product2.Description</column>
<column>UnitPrice</column>
<column>Quantity</column>
<column>TotalPrice</column>
</LineItems> }}-->

We add style class in class tag. If no css is needed, then use none in place of style class.

Or one can use direct soql :

<td> Account Team Members:
<!--{{! <LineItemsSOQL>
<class>none</class>
<soql>
select user.name from accountteammember where accountid='{!account.id}'
</soql>
<column postfix=", ">user.name</column>
</LineItemsSOQL> }}-->
</td>

Leave a Reply

Your email address will not be published. Required fields are marked *

Share on:
Share this...
Share on Facebook
Facebook
Tweet about this on Twitter
Twitter
Share on LinkedIn
Linkedin
Website security
Contact Us