Category

Documentation

Input Field Groups

By Documentation, S-Sign No Comments

S-Sign Input Field Groups allow you to group checkbox fields together and set minimum and maximum requirements for the group as a whole. This feature is useful is you want users to choose a fixed or ranged number of options from a list. For example, let's say your document lists five different contact methods, and you want users to select at least 2 preferred methods from the list. S-Sign input field groups make this easy to implement.

This article will go over setting this feature up, as well as the end-user experience.

Locate the Input Field Group Settings

The S-Sign Input Field Group settings are located at the bottom of the S-Sign Template Settings menu (if you do not see the S-Sign panel on the left of the template editor, you need to enable S-Sign for your template).

Create an Input Field Group

To create an input field group, click Add Input Field Group. This will bring up the input field group menu.

[1] Input field group name: Add a name for your input field group. Once you save the template, this name will show up in the Input Field Group picklist on the S-Sign checkbox field menu. Any checkbox fields with this name selected will be included in this input field group and governed by its requirements.

[2] Minimum required for signing: Set a minimum number of checkboxes in this group that must be checked before the document can be submitted.
[3] Maximum required for signing: Set a maximum amount of checkboxes in this group that can be checked before the document can be submitted.
[4] Custom Warning Message: Enter a custom warning message that will be displayed as a popup when a user selects too many or too few options part of this group.
[5] Custom Error Message: Enter a custom error message that will be displayed on the document when a user selects too many or too few options part of this group.
[6] Custom error message styling: Enter custom styling for error messages that appear on the document when a user selects too many or too few options part of this group. This field accepts CSS syntax.
[7] Suppress Form Level Errors: Check this box to prevent error messages from being displayed on the document.

Note: This will not prevent custom warning messages from displaying as popups, if any have been defined.

[8] Remove input group: Remove this input field group and delete its settings.
[9] Add Input Field Group: Add another input field group.

Example Use Case

Let's say we want users to choose at least two preferred contact methods from a list of five contact methods in a document. The following input field group satisfies this requirement.

First, we named the input field group "Contact." If we wanted to create other input field groups later, descriptive names will help differentiate between them. Next, we set the minimum required inputs to 2 and the maximum to 5, since our group will include 5 checkboxes, and we want users to be able to select as many as they want (as long as it's more than 2). If we wanted them to select only 2 contact methods, we would set the maximum number to 2 as well.

We also input custom error messages and added styling to match our brand.

Next, we'll create five checkbox fields and assign them to the input field group that we just created by setting their Input Field Group field to Contact. Then, we'll paste the S-Sign tags into our template.

That's all there is to it! When we generate the document and send the S-Sign request, users will be able to select 2-5 contact options.

If a user tries to submit the document with less than 2 options selected, an error will appear and indicate how many options that they should select.

Although this is a simple example, you can create as many input field groups as you like and customize them as needed to satisfy your requirements.


Using Arithmetic Functions

By Documentation, General Solutions, S-Docs Cookbook No Comments

Arithmetic Function Syntax

S-Docs templates support arithmetic functions for both static numbers and numeric fields. All functions should be written using standard Salesforce math operators. S-Docs will evaluate all functions using the standard mathematical order of operations.

To use arithmetic functions in your S-Docs templates, simply enclose the function within <MATH> tags.

The following example uses both static numbers and numeric fields.

[code lang="html"]<MATH>(2 + 1) / 3</MATH>

<MATH>( {{!Opportunity.Num1__c}} + {{!Opportunity.Num2__c}} ) / {{!Opportunity.Num3__c}}</MATH>[/code]

Note: You can use negative numbers in your functions. Keep in mind that subtraction functions should include a space on either side of the minus symbol to differentiate between negative numbers and subtraction functions. For example, to evaluate three minus two, use the following syntax:

[code lang="html"]<MATH>3 - 2</MATH>[/code]

Instead of something like this:

[code lang="html"]<MATH>3 -2</MATH>[/code]

Formatting Numbers

To format the result of your arithmetic function, use the format-number attribute within the <MATH> tag as shown below, but not within the merge fields.

[code lang="html"]<MATH format-number="#,###.##">{{!Opportunity.amount}} - {{!Opportunity.expectedrevenue}}</MATH>[/code]

Note: When you insert numeric fields using the Insert Field button, number formatting is added to the merge fields automatically. Ensure that you remove this formatting when using merge fields within arithmetic functions.

Arithmetic Functions with Date Fields

You can also use date fields or static dates within your arithmetic functions. The two main types of date math supported are:

  1. Adding/subtracting time from a date
  2. Evaluating days/months between dates

Both types of date math require the use of the type="date" attribute within your <MATH> tag.

Note: Static dates must be written in the yyyy-MM-dd format (for example, January 1, 2021 would look like 2021-01-01).

Adding/Subtracting Time

To add or subtract days, months, or years from any date field, use the following syntax (where X equals the number of days, months, or years you would like to add or subtract from the value of the date field):

[code lang="html"]<MATH type="date">{{!Opportunity.createdByDate}} + DAYS(X) - MONTHS(X) + YEARS(X)</math>[/code]

Evaluating Time Between Dates

To evaluate the time between two dates, use the following syntax:

[code lang="html"]<MATH type="date">DaysBetween({{!Opportunity.createdByDate}},{{!Opportunity.closedate}}</MATH>
<MATH type="date">MonthsBetween({{!Opportunity.createdByDate}},{{!Opportunity.closedate}}</MATH>
<MATH type="date">YearsBetween({{!Opportunity.createdByDate}},{{!Opportunity.closedate}}</MATH>[/code]

Formatting Dates

To format the result of your arithmetic date function, use the format-date attribute within the <MATH> tag as shown below, but not within the merge fields.

[code lang="html"]<MATH type="date" format-date="M/dd/yyyy">[/code]

Note: When you insert date fields using the Insert Field button, date formatting is added to the merge fields automatically. Ensure that you remove this formatting when using date fields within arithmetic functions.

DOCX Syntax

When using arithmetic functions in DOCX templates, use lowercase <math> tags and be sure to enclose the entire function within square brackets, as shown in the following example.

[code lang="html"][<math>(2 + 1) / 3</math>]
[<math>( {{!Opportunity.Num1__c}} + {{!Opportunity.Num2__c}} ) / {{!Opportunity.Num3__c}}</math>][/code]


The S-Sign Configuration Page

By Documentation, S-Sign No Comments

Navigate to the S-Sign Configuration Page

The S-Sign Configuration page provides you with a number of administrative configuration options for S-Sign, including licensing information and Salesforce site configuration. This article will go over each setting on this page. For more information on S-Sign template-level configurations, please view the S-Sign Template Settings.

If you are using S-Docs 4.381+, the S-Sign Configuration page can be accessed through the S-Docs Setup page (App Launcher > S-Docs Setup > Go to S-Sign Setup Page).

If you are using a version of S-Docs below 4.381, the S-Sign Configuration page can be accessed through one of the following links:

[Production]: https://login.salesforce.com/apex/SSIGN__SSConfig">https://login.salesforce.com/apex/SSIGN__SSConfig
[Sandbox]: https://test.salesforce.com/apex/SSIGN__SSConfig">https://test.salesforce.com/apex/SSIGN__SSConfig

The S-Sign Configuration page appears as follows:

S-Sign Licensing Page

The first section of the S-Sign Configuration page is where your S-Sign license key data is housed, as well as where you assign/remove licenses from your users. Click Go To S-Sign License Page to be routed to the S-Sign license page, which is shown below.

The S-Sign license page allows you to:

[1] Enter your license key for the first time, or update your license key
[2] View your org's license information, including the expiration date, total license count, and how many licenses have been used
[3] View which users have been assigned licenses, as well as remove them
[4] Assign licenses to additional users in your org

For more information about assigning S-Sign licenses, click here.

S-Sign Configurations

The S-Sign Configurations section appears as follows:

This section allows you to:

[1 & 2] Provide S-Sign with the Site Label and Site URL of the Salesforce site that you created during the initial configuration of S-Sign. These fields are automatically populated with this information when you create your S-Sign site, but you should still copy and paste your Site Label and Site URL here to ensure that they match. Click here for more information about ensuring that these values are correct.
[3] Confirm your Salesforce Site information and assign the S-Sign Guest User permission set. This is all completed in the background when you click the button.
[4] Enable reminder and expiration emails for your e-signature requests (these are disabled by default). You can configure expiration and reminder settings at the template level within the S-Sign template settings menu.
[5] Assign an S-Sign license to your S-Sign Internal User, if one has not already been assigned. Learn more about the S-Sign Internal User here.

S-Sign Custom Settings

The S-Sign Custom Settings section appears as follows:

This section allows you to:

[1] Display the S-Sign Audit Trail to each person who signs a document. By default, the audit trail is appended to the signed document after all signers have signed. Checking this box will display the audit trail throughout the signing process. For example, signer 2 will receive the document with an audit trail that includes details from signer 1, signer 3 will receive the document with an audit trail that includes details from signers 1 and 2, and so on.
[2] When using S-Sign with Salesforce Communities, open all Sign In Person requests in a new tab
[3] Select an org-wide email address as your email alias for all S-Sign notification emails.
[4] Insert the signed document with the audit trail as an attachment on your base record. By default, the signed document with the audit trail is saved as a Salesforce file on the S-Sign Envelope Document record, and then linked to the base record using ContentDocumentLink. This option will save the document as an attachment on the S-Sign Envelope Document record, and then save a cloned version of the attachment to the base record.
[5] Prevent signers from using the text-to-signature feature. This will require them to draw their signature.
[6] Replace the S-Sign logo with your organization's logo throughout the signing process (including the security verification splash screen and the S-Sign toolbar that appears at the bottom of the screen when users are signing a document).
[7] Specify the reply-to email address for all S-Sign emails. This field accepts any valid email address. If left blank, the reply-to email address for all S-Sign emails will be automatically set to the email of the user sending the request.
[8] Use a custom permission set for the S-Sign Site Guest User, in place of the permission set that is automatically assigned when you click Set Site Info & Assign Permissions in the S-Sign Configurations section of this page.
[9] Select a default font to use for for the text-to-signature feature.
[10] Save your settings.

For more information about configuring and customizing S-Sign, please visit our S-Sign General Configuration page.


Integrating S-Docs with Box

By Documentation No Comments

Setting Up S-Docs Box Integration

S-Docs integrates seamlessly with cloud storage solution Box, meaning that you can generate documents securely on the Salesforce platform and then store them with Box -- all without ever leaving Salesforce. This article will provide you with step-by-step instructions for configuring the S-Docs Box integration. For the purposes of this guide, we'll assume that you have already installed the Box for Salesforce application from the AppExchange. If not, you can download it here.

Create a New Apex Class

To begin, create a new Apex class. In the setup menu, type "Apex classes" into the Quick Find bar, then click Apex classes from the options that drop down, and click New.

Paste in the Apex class listed below, then click Save.

[code lang="html"]public class SDBoxUploadController {
public PageReference uploadToBox() {
String attachmentId = ApexPages.currentPage().getParameters().get('attId');
String sdocId = ApexPages.currentPage().getParameters().get('sdocId');
SDOC__SDoc__c sdoc = [SELECT SDOC__GD_Status_Text__c FROM SDOC__SDoc__c WHERE Id=:sdocId FOR UPDATE];
Attachment att = [SELECT Name, Body, ParentId FROM Attachment WHERE Id=:attachmentId FOR UPDATE];
Box.Toolkit boxToolkit = new Box.Toolkit();
boxToolkit.createFileFromAttachment(att, null, null, null);
boxToolkit.commitChanges();
String mostRecentError = boxToolkit.mostRecentError;
if (mostRecentError != null && mostRecentError != '') {
throw new SDException(mostRecentError + ' (some uploads fail because a file with this filename already exists on Box)');
}
sdoc.SDOC__GD_Status_Text__c = 'Linked to Box';
update sdoc;
return new PageReference('/' + ApexPages.currentPage().getParameters().get('redirectId')); }

public class SDException extends Exception {}
}[/code]

Create A New Visualforce Page

Next, create a new Visualforce page. In the setup menu, type "Visualforce" into the Quick Find bar, click Visualforce Pages from the options that drop down, then click New.

Enter the following values for your Visualforce page, then click Save.

Label: SDBoxUpload
Name: SDBoxUpload
Visualforce Markup:

[code lang="html"]<apex:page controller="SDBoxUploadController" action="{!uploadToBox}">
</apex:page>[/code]

Add The "Box Enabled" Field To Your S-Docs Templates

In order to enable the Box storage option for your S-Docs templates, you need to add the Box Enabled field to the template record layout. Navigate to the Object Manager in the Setup menu and find the SDoc Template object.

Navigate to the Page Layouts tab and click Edit.

Navigate to the Fields tab in the top menu, then find the Box Enabled field. Drag it down onto the SDoc Template Detail layout, and click Save.

To enable Box storage for a template, check the Box Enabled box when creating the template, or edit the template record detail page to check the box for templates that you've already created.

You'll also need to enable the Create Salesforce Attachment and link to record feature. This checkbox is found under the Document Options tab of the template editor, and is enabled by default.

Configure Box Settings

Next, you'll need to configure your admin and user settings for the Box application for Salesforce. Navigate to the Box application and configure your settings under the Box Settings tab. Once your settings are configured, click Sync Now.

You'll also need to enable Box for the objects that you're using with S-Docs. Click here for detailed instructions on installing and configuring Box for Salesforce.

Uploading Documents To Box

Once you've configured S-Docs and Box, navigate to an object record that you've enabled for both apps. Click the S-Docs button and select a box-enabled template. Then, click Next Step to generate the document.

You'll now see an Upload Selected Documents to Box button. Click the button to upload your generated documents to Box. Once complete, you can then email, view, download, or print your documents like normal.

When you view the record that you generated this document from, your document will be viewable within the Box iframe:

And you'll now be able to view and access your documents from box.

Automatically Upload Documents To Box

Although the default S-Docs & Box integration allows you to choose whether or not a document should be uploaded to Box, you can also modify this configuration so that documents are automatically uploaded to Box whenever they are generated. To do so, simply modify your S-Docs button URL and add the autoBox='1' parameter to the end. For example, an S-Docs Opportunity button with the automatic Box upload feature would look like this:

[code lang="html"]{!URLFOR('/apex/SDOC__SDCreate1', null,[id=Opportunity.Id, Object='Opportunity', autoBox='1'])}[/code]

Box Error Handling

By default, errors that occur during document upload to Box will throw an exception and roll back any DML occurring in the Box package.

To prevent this behavior, you can opt to instead handle error messages at the UI layer, which will not roll back DML occurring in the Box package. This requires adding a parameter to your S-Docs button and creating a new Apex class.

1. Add New S-Docs Button Parameter

From the Setup menu, navigate to your object in the Object Manager. Then, navigate to the Buttons, Links, and Actions tab, find your S-Docs button, click the dropdown arrow, and click Edit.

Add the following parameter to your S-Docs button URL:

[code lang="html"]boxUploadClass='SDBoxUploadControllerNew'[/code]

Click Save.

2. Add New Apex Class

Navigate back to the Setup menu. Type "Apex" into the Quick Find bar, click Apex Classes in the dropdown menu, then click New.

Paste in the following Apex class.

Name: SDBoxUploadControllerNew

Class:

[code lang="html"]global class SDBoxUploadControllerNew implements Callable {

String uploadToBox(String attId, String sdocId) {
SDoc__c sdoc = [SELECT GD_Status_Text__c FROM SDoc__c WHERE Id=:sdocId FOR UPDATE];
Attachment att = [SELECT Name, Body, ParentId FROM Attachment WHERE Id=:attId FOR UPDATE];
Box.Toolkit boxToolkit = new Box.Toolkit();
boxToolkit.createFileFromAttachment(att, null, null, null);
boxToolkit.commitChanges();
String mostRecentError = boxToolkit.mostRecentError;
if (mostRecentError != null && mostRecentError != '') {
sdoc.GD_Status_Text__c = 'Error When Linking to Box';
return (mostRecentError + ' (some uploads fail because a file with this filename already exists on Box)');
}
sdoc.GD_Status_Text__c = 'Linked to Box';
update sdoc;
return '';
}

// Dispatch actual methods
public Object call(String action, Map<String, Object> args) {
switch on action {
when 'uploadToBox' {
return this.uploadToBox((String)args.get('attId'), (String)args.get('sdocId'));
}
when else {
throw new ExtensionMalformedCallException('Method "uploadToBox" not implemented');
}
}
}

public class ExtensionMalformedCallException extends Exception {}
}[/code]

Once you click Save, you're all set!

Additional Resources

If you want to update your Box integration folder configurations, you can update the createFileFromAttachment function in the controller SDBoxUploadController mentioned above. For more information, please consult Box's Salesforce Toolkit documentation.


S-Sign With PDF-Upload

By Documentation, S-Sign No Comments

S-Sign with PDF-Upload

The S-Docs PDF-Upload feature allows you to upload any PDF to the S-Docs template editor, then drag and drop merge fields onto the document. This feature is also compatible with S-Sign, allowing you to create S-Sign fields and drag & drop them onto your uploaded PDF. This article will demonstrate using S-Sign with the PDF-Upload feature.

Before using the PDF-Upload feature, you will need to add it as a value for the Template Format field on the SDoc Template object. Refer to the S-Docs PDF-Upload documentation (linked above) to learn how to do this.

Enable S-Sign For Your Template

After you create your PDF-Upload template, you'll need to enable S-Sign as your template's e-sign vendor. Navigate to the Advanced Options tab and choose S-Sign from the dropdown menu. Once you do this, you need to save your template before proceeding by clicking the Save button above.

Locate the S-Sign Settings

Once your template is saved, navigate back to the Upload PDF tab and click Create Another Field.

Here, unlike with regular PDF-Upload templates, you can now select "S-Sign Field" for the Type field. You'll notice that the regular S-Sign Settings menu didn't appear here like it does for regular S-Sign enabled templates; to access the S-Sign settings, click S-Sign Settings at the bottom of the PDF-Upload Settings menu.

Configure Your S-Sign Template

Clicking S-Sign Settings will open up the S-Sign Settings menu, where you can configure every aspect of your S-Sign template like normal, including field types, different signer profiles, and general settings. Click Field Settings to go back to the PDF-Upload settings and drag your S-Sign field onto your document.

Once you navigate back to the PDF-Upload settings, you can drag your S-Sign Input tag onto your document. A Re-Drag Merge Field button will appear, which you can click to reset the signature tag and drag it again.

Once you're finished configuring all of your fields, signer profiles, and template settings, you can use this template like you would any other S-Sign template.


PDF-Upload

By Documentation, General Solutions, S-Docs Cookbook No Comments

Introduction

The S-Docs PDF-Upload feature allows you to upload any preexisting PDF to the S-Docs template editor. Once your PDF is uploaded, you can use the intuitive user interface to drag and drop merge fields onto your document. There's no need to copy and paste when using this feature: simply grab the merge field and place it wherever you'd like. This article will explain how to access the PDF-Upload feature, navigate the user interface, and customize your merge fields with your own styling. Before we dive in, here's a quick look at the feature in action:

Access PDF-Upload

To access the PDF-Upload feature, you'll need to add it as a Template Format value on the SDoc Template object. From the setup menu, navigate to the Object Manager and find the SDoc Template object.

Next, navigate to the Fields and Relationships tab, and click on the Template Format field.

Scroll down to the Values section and click New. Type PDF-UPLOAD into the text box, then click Save.

You've now successfully added the PDF-Upload option to the Template Format field. To create your first PDF-Upload template, simply select this option as your template format.

Using PDF-Upload

We will now go over basic usage of the PDF-Upload feature. To begin, navigate to the Template Editor for your PDF-Upload template, then click Upload PDF File under the Upload PDF tab, and choose a PDF.

Your PDF will appear on the right, and options will appear in the left menu.

PDF-Upload Settings

The two menus available to you are [1] S-Docs Fields, which is where you'll select your merge fields to drag and drop, and [2] PDF-Upload Settings, which we'll go over now.

The PDF-Upload Settings allow you to [3] apply a default style for how all of your merge field data will display. This styling box accepts CSS syntax. For example, if we want our merge field text to be 20 pixels, we'd add font-size: 20px; into the box. This styling can also be overridden for any individual merge field.

S-Docs Fields

The S-Docs Fields menu allows you to create merge fields, apply individual styling, write conditional statements for those fields, and drag and drop them onto your document. If your PDF-Upload template is S-Sign enabled, this menu is also where you'll configure your signature tags. Click Create Another Field to get started.

This is the merge field menu.

Begin by [1] selecting the type of field. In this case, we're going to select merge field. If S-Sign was enabled for this template, we could also use this picklist to choose an S-Sign field. Next, [2] click Select Merge Field to find your merge field.

This will [1] bring up a list of all available fields for your base object, which in this case is Opportunity. You can also [2] select special merge fields to insert information such as document date, document name, or the name of the user generating the document. When you [3] select your merge field, you can access fields from related objects by clicking on fields with the > symbol next to them, just like you can with any other S-Docs template. This functionality allows you to go three levels deep. In this example, we're selecting the billing address for the account related to this opportunity. When you find your desired field, [4] click Insert Field.

As you can see, [1] the merge field was added into the Merge Field text area, meaning that this field will now display data from this opportunity's account billing address.

Remember the default merge field styling we applied earlier? You can [2] override this styling by adding additional CSS in the Additional Style field. If the default font size is 20 pixels, we could add font-size: 12px; here so that this field appears smaller than the rest.

You can additionally [3] insert conditional logic in the Render If field to render this field data only under certain conditions. This field accepts the same syntax as the S-Docs Conditional Logic feature, omitting the render tags. For example, let's say we only want the account's billing address to display if the opportunity is closed. We would add {{!Opportunity.stagename}} == 'Closed' into this field.

Finally, [4] drag your field (SDOCS INPUT ID=1) and place it on your PDF. Once you do, you can reset this field by clicking the Re-Drag Merge Field button, then drag it again. If you no longer need a field, you can [5] click Delete Field to delete it. [6] Click Create Another Field to repeat this process as many times as you'd like; there's no limit to the amount of merge fields you can use!

Once you've added all of your merge fields, it's time to generate your document!

As you can see, S-Docs merged in all of our Salesforce data in the areas that we specified. That's all there is to it! The PDF-Upload feature was designed to give you maximum flexibility and ease of use while maintaining the powerful feature functionality of S-Docs.

Note that the PDF-Upload templates work with the Live Edit feature. If your PDF-Upload template is Live-Edit enabled, users will be able to edit the field data after the document is generated.

PDF-Upload Limitations

While PDF-Upload is a robust and easy-to-use feature, there are a few limitations to consider when using it.

Note: Limitations to PDF files in general also apply to the PDF-Upload feature in addition to the limitations listed here.
  • PDF is the only file type supported
  • Pre-existing templates cannot be switched to the PDF-Upload template format
  • PDF-Upload templates cannot be switched to a different template format
  • The Header, Footer, Page Settings, and Auto Create Task tabs are not available
  • PDFs must be the traditional 8.5 x 11 inch size; landscape PDFs are not supported
  • The page count upper limit is currently around 15 pages. Keep in mind that certain contents increase template size and complexity (such as images or large amounts of text), which may have an effect on the page number limitation
  • To export templates and transfer them between orgs, use the S-Docs Template Migrator instead of manually exporting and importing the template data.
  • Component templates are not supported
  • Related Lists are not supported
  • Conditional statements need to be written out (the Insert Conditional Logic button is not supported)
  • Nested renders are not supported
  • Named queries are not supported
  • SOQL queries are not supported


Void A Contract Before It’s Signed

By Documentation, S-Sign No Comments

You may run into a situation where a contract that you've sent out for signature needs to be voided. As long as nobody has signed the document, S-Sign allows you to void contracts that you've sent right from the Salesforce record that they were sent from.

Add The "Void Contract" Field to the S-Sign Envelope Related List

Contract voiding is done from the S-Sign Envelope related list, so you'll need to add this field to that related list to begin. Navigate to Setup > Object Manager > Your Object. In this example, we're going to edit the Opportunity object's S-Sign Envelope related list.

Click on the Page Layouts tab, then click Edit for the appropriate page layout.

Scroll down to the related list section of the layout editor. Find the S-Sign Envelopes related list, and click the wrench icon.

Find the Void Contracts field in the related list properties menu, and click the Add arrow to add it to the related list. Click OK at the bottom of the menu.

Save your new layout. You'll now be able to void contracts from the S-Sign Envelopes related list.

Voiding Contracts

To void a contract, navigate to the object record that it was generated from. Scroll down to the S-Sign Envelopes related list, and click the Void Contracts link that appears there. If you don't see the link, click View All to open an expanded view.

Once you click the link, you'll be taken to the following page.

Here you can optionally enter a reason for voiding the contract, and then click Void The Above Contracts to void them. Note that all recipients of the contract will be notified when it is voided.


Build Templates With A Dynamic Number Of Signers

By Documentation, S-Sign No Comments

Introduction

S-Sign allows you to easily send e-signature requests that require multiple signers by building out multiple signer profiles in a template. However, it's not always practical to rely on a fixed number of signer profiles. Sometimes a document might require only one signer, while other times it might require five. Maybe a document always needs to be signed by every contact role related to an opportunity. In these situations, it's not efficient to constantly edit the number of signer profiles for a template.

Luckily, S-Sign allows you to set a dynamic number of signer profiles and signature inputs for a document. There are two primary ways to do this:

  1. Using the Render Feature
  2. Using Related Lists

Using the Render Feature

The S-Docs Render Feature allows you to conditionally show or hide portions of your documents based on conditions that you define, but it can also be used to conditionally render S-Sign elements, like specific signer profiles and different S-Sign input field types. Using the render feature, you can set up s-sign templates that include a different number of signers and input fields based on certain predefined conditions.

In the following example, we've written our render statement so that Signer 2's signer profile (and corresponding signature input field) will only get created if the Opportunity that this document is generated from has its stage field set to Closed.

[code lang="html"]<!--RENDER='{{!Opportunity.StageName}}' == 'Closed' -->
[[SSIGN_PROFILE Email='signer2@example.com' ProfileName='Signer 2' RoutingPosition='2']]
[[SSIGN_INPUT Profile='Signer 2' Type='Signature']]
<!--ENDRENDER-->[/code]

As you can see, using the render feature to set dynamic signer profiles requires you to write out your S-Sign elements, rather than set them in the S-Sign Template Settings menu. You can use the following attributes in your render statements, which are equivalent to the elements that you can set in the S-Sign Template Settings.

S-Sign Profile Attributes:

  • ProfileName
  • Email
  • RoutingPosition
  • DenyAudit
  • DenyConfirmation
  • SignerName
  • PrevSignerProvidesThisSignersEmail
Note: These attributes must be preceded by SSIGN_PROFILE, and the entire statement must be enclosed in double square brackets. For example: [[SSIGN_PROFILE Email='signer2@example.com']]

S-Sign Input Field Attributes:

  • Type
  • Profile
  • Required (Type='Text', Type='Checkbox', and Type='Date' only)
  • WriteTo (Type='Text' and Type='Date' only)
  • TextDefault (Type='Text' only)
  • Disabled (Type='Date' only)
  • DateFormat (Type='Date' only)
Note: These attributes must be preceded by SSIGN_INPUT, and the entire statement must be enclosed in double square brackets. For example: [[SSIGN_INPUT Profile='Signer 2' Type='Signature']]

Using Related Lists

You can also dynamically generate signer profiles and input fields using related list data (LineItems and LineItemsSOQL). This is useful if you need to generate S-Sign requests that automatically include signer profiles and input fields for each contact role related to a specific record.

In the following example, let's assume you have a contract that needs to be signed by each opportunity contact role and each account contact role related to your opportunity. Let's also assume that all opportunity contact roles need to sign before any account contact roles sign. Using LineItemsSOQL statements, S-Sign can easily accomplish this. For each object (opportunity and account), we'll create 2 LineItemsSOQL statements: one to generate signer profiles, and another to generate S-Sign input fields.

[code lang="html"]<!--{{!
<lineitemsSOQL>
<class>none</class>
<listname>opportunitycontactrole</listname>
<column prefix="[[SSIGN_PROFILE Email='" postfix="' ">Contact.email</column>
<column prefix="RoutingPosition='1" postfix="' ">rownum</column>
<column prefix="ProfileName='Signer C" postfix="']]">rownum</column>
<where>Opportunity.Id='{{!Opportunity.Id}}'</where>
</lineitemsSOQL>
}}-->
<!--{{!
<lineitemsSOQL>
<class>table239</class>
<listname>opportunitycontactrole</listname>
<column>Contact.Name</column>
<column prefix="<br /><div style='width:20pt;' />[[SSIGN_INPUT Type='Signature' Profile='Signer C" postfix="']]">rownum</column>
<where>Opportunity.Id='{{!Opportunity.Id}}'</where>
</lineitemsSOQL>
}}-->
<!--{{!
<lineitemsSOQL>
<class>none</class>
<listname>accountcontactrole</listname>
<column prefix="[[SSIGN_PROFILE Email='" postfix="' ">Contact.email</column>
<column prefix="RoutingPosition='2" postfix="' ">rownum</column>
<column prefix="ProfileName='Signer A" postfix="']]">rownum</column>
<where>Opportunity.Id='{{!Opportunity.Id}}'</where>
</lineitemsSOQL>
}}-->
<!--{{!
<lineitemsSOQL>
<class>table239</class>
<listname>accountcontactrole</listname>
<column>Contact.Name</column>
<column prefix="<br /><div style='width:20pt;' />[[SSIGN_INPUT Type='Signature' Profile='Signer A" postfix="']]">rownum</column>
<where>Opportunity.Id='{{!Opportunity.Id}}'</where>
</lineitemsSOQL>
}}-->[/code]

When you use the code listed above, each opportunity contact role will be designated an incrementing signer profile name starting at Signer C1, and each account contract role will be designated an incrementing signer profile name starting at Signer A1. Additionally, all opportunity contact roles will sign before any account contact roles sign because of how we set the RoutingPosition attribute. In this example, a signature input will be generated for each contact role, but you can customize this code to generate any number of different s-sign inputs.


Troubleshooting S-Sign

By Documentation, S-Sign No Comments

Troubleshooting The End-User Experience

This section of the S-Sign troubleshooting guide will focus on the end-user experience, which includes both users generating S-Sign requests in Salesforce, and users signing documents.

General Troubleshooting Steps

If you're running into problems while using S-Sign, it's always best practice to take note of the following general steps.

  1. Ensure that the domain listed for your S-Sign site in the S-Sign Configuration page is the same as the domain listed for your S-Sign site in the Salesforce sites list (Setup > Sites > Your Site).
    To get to the S-Sign Configuration page, navigate to one of the following links:
    [Production] https://login.salesforce.com/apex/SSIGN__SSConfig
    [Sandbox] https://test.salesforce.com/apex/SSIGN__SSConfig
    Make sure the URLs match. If they don't, copy the site URL from the Salesforce sites page and paste it into the box on the S-Sign Configuration page.


    Additionally, if there are two sites listed, make sure to use the one that ends with secure.force.com.
  2. Ensure that the active user has an S-Sign license assigned to them. You can view license assignments by navigating to the S-Sign Configuration page and clicking Click here to be redirected to the S-Sign License Page at the top.

    From there, scroll down to view license assignments or assign new licenses.
  3. Ensure that you have the correct Sharing Settings enabled for all of the S-Docs and S-Sign objects (Setup > Sharing Settings).
  4. Ensure that the active user's profile has all field-level permissions enabled for the S-Docs and S-Sign objects (make sure the "Read" field is checked as well).
  5. Ensure that the active user's profile has access to the S-Sign VisualForce pages. You can find a list of these in Step 2 of the S-Sign Installation and Configuration Guide.

Site is Down For Maintenance Error

If users are taken to a "site under construction" or "site down for maintenance" page when clicking the link that should take them to the signable document, this may be because there is a missing forward slash character in the S-Sign site URL.

In order to fix this, navigate to the S-Sign configuration page and ensure that the URL shown there has a forward slash character at the end.

Infinite Loading Spinner On The Signature Capture Page

You may run into an issue where signers are stuck on the loading screen after verifying their email and clicking Continue to proceed to the document. The screen would look similar to this:

There are several reasons that this may happen.

  1. The S-Sign input tag [[SSIGN_INPUT ID=X]] isn't present in the template. We recommend first going back to the template editor and making sure that the S-Sign input tag didn't get removed or accidentally left out of your document.
  2. The S-Sign input tag is breaking across two lines. When the S-Sign input tag breaks across two lines in the generated PDF, it cannot be read by the PDF reader. We recommend editing your S-Sign input tag so that it only occupies one line, either by making the font smaller, or making its container larger.
    Note: Your S-Sign input tag may only take up one line in the S-Docs template editor, but break across two lines when you generate the PDF. This is because the template editor spans the width of your browser, but the PDF body is the page width minus the left and right margins (as defined in the Page Settings tab of the template editor). If you want to make the template editor's width more accurate, you can wrap everything in a <div> tag with a width that's equivalent to the generated PDF's page width. For example, if the page width is 8.5 inches and the left and right margins are 1 inch each, you would wrap everything in <div style="width:6.5in;"></div>
  3. The S-Sign input tag is hidden by a narrow table cell. If your S-Sign input tag is in a table cell that is too narrow, the tag may not render at all and thus be unreadable by the PDF reader. To fix this, make the table cell that includes the S-Sign input tag wider. Again, ensure that the tag doesn't break across two lines.

Errors When Submitting Or Declining A Document

On newer versions of S-Docs and S-Sign, signers may receive error messages when they submit or decline a document if the S-Sign Site Guest User doesn't have access to all of the appropriate fields used in your email notification templates. To resolve this error, navigate to your S-Sign site's public access settings (Setup > Sites > Your Site > Public Access Settings) and give the Site Guest User profile Read access to all objects and fields referenced in your email notification templates.

Issues With The "Sign Here" Image or Broken Signature Images

If the blue "Sign Here" arrow image (shown below) on an S-Sign document appears as a broken image icon, or if there are broken signature images in your audit documents, it may be because of S-Sign site URL issues.

Verify that the URL listed on the S-Sign Configuration page matches the URL listed on your Salesforce sites page (as described in Step 1 of the General Troubleshooting Steps section above). If your sites list has two URLS, make sure to use the one that ends with secure.force.com.

If you are still having problems, ensure that your site URL is preceded by https://, as opposed to http://.

Troubleshooting The Admin Experience

This section of the S-Sign troubleshooting guide will focus on the admin experience, which includes building S-Sign enabled templates.

S-Sign Sidebar Issues

If the S-Sign sidebar panel is not loading correctly in the S-Docs template editor, there are two options to resolve this.

Option 1: Clickjack Protection

Navigate to Setup > Session Settings. Then, uncheck the following checkboxes:

  • Enable clickjack protection for customer Visualforce pages with standard headers
  • Enable clickjack protection for customer Visualforce pages with headers disabled

Option 2: Whitelisted Domains for Visualforce and Survey Inline Frames

If you need to keep clickjack protection enabled for Visualforce pages, you can also resolve this issue by whitelisting the domain of the template editor. To find the correct domain, navigate to an S-Docs template record and open the template editor by clicking the Template Editor button.

Note: You must be in Salesforce Classic to copy the correct domain. If you are working in Salesforce Lightning, switch to Salesforce Classic by clicking your user profile button in the upper right corner, and then click Switch to Salesforce Classic.

Once you have switched to Salesforce Classic, copy the domain from your browser's URL bar.

Next, navigate to Setup > Session Settings, and scroll down to the Whitelisted Domains for Visualforce and Survey Inline Frames section, and click Add Domain.

Then, paste the domain into the Domain field. Make sure that the IFrame Type field is set to Visualforce Pages.

The domain will now appear in the Whitelisted Domains section, and the S-Sign sidebar panel will now load correctly in the template editor.

Finding Site Guest User Profiles

Site Guest Users don't normally appear in the profiles page in the setup menu. If you need to access Site Guest User profiles, you can run the following query in the Dev Console (Setup Cog > Developer Console):
[code lang="html"]SELECT Name, Id FROM User WHERE Name LIKE '%Site Guest%'[/code]
This can be useful for ensuring that the correct permissions are assigned to S-Sign users -- specifically the S-Sign Site Guest User permission set.


Generate A Component Template For Each Record In A List Of Records

By Documentation, General Solutions, S-Docs Cookbook No Comments

Introduction

This article will teach you how to build an S-Docs template that will generate an entire component template within it for each record in a list of Salesforce records.

Let's say you wanted to create a single summary document of each opportunity related to an account, but you don't want to use the standard related list table formatting. You could remove the table CSS styling by using <class>none</class>, but this will only output your data as a comma-delimited list.

Using this feature, you could create a component template for your related opportunity data and format the data in any way you'd like. Then, when you generate a parent template that references the component template, you'll have a single document with your custom-formatted component template repeating itself for each opportunity record in your account's related list.

This feature works with any list of Salesforce records.

If you need to generate a separate document for each record in a list of records, click here.

This feature involves two templates:

  1. The parent template: This template will end up being the final document where all of the record data is displayed. It is the template that the end user will select and generate.
  2. The component template: S-Docs component templates are templates that are built to be displayed within other templates, and are not generated as stand-alone documents. This template will be used to configure how data from each record is displayed in the parent template. It won't be seen or selected by the end user. Although it's only one template, it will repeat itself in the parent template for each record in the list that you specify.

Create The Parent Template

To begin, we'll create the parent template. Let's say we want to generate a document from the Account object that has data merged in from each opportunity record in the Opportunity related list. Create a new S-Docs template, and ensure that the Related To Type field is set to Account (or whichever base object you're working with).

Navigate to the template editor and click on the Source button. There are two different ways to write the component query.

Method 1:

This method will run 1 SOQL query for each component merged. It's ideal for shorter lists of records. Paste something like the following into the source of the template editor.

[code lang="html"]<!--{{!<LineItemsSOQL>
<component>Component_Template</component>
<soql>SELECT Id FROM Opportunity WHERE AccountId='{{!Account.Id}}'</soql>
</LineItemsSOQL>}}-->[/code]

This LineItemsSOQL statement will be where our component template appears for each record in the related list. Let's dig a little deeper into what's going on here.

After opening the LineItemsSOQL statement, we've specified the name of our component template, Component_Template, within the <component> tags.

After this, we've written a SOQL query that will allow the component template to pull field data from opportunities related to our account. This feature isn't limited to related lists, however - you can query any object in your org with any filter conditions.

Because this method runs a SOQL query for each component merged, it may not be scalable for large lists of records. In that case, you can use method 2.

Method 2

Note: Method 2 is available in S-Docs 4.447+

This method will run 1 SOQL query in total, no matter how many components are merged. It's ideal for longer lists of records. Paste something like the following into the source of the template editor:

[code lang="html"]<!--{{!<lineitemsSOQL>
<class>none</class>
<soql>SELECT id, name, stagename from opportunity WHERE AccountId='{{!Account.Id}}'</soql>
<component columnFields="true" mergeFieldPrefix="prefix">Component_Template</component>
<column componentMergeField="true">id</column>
<column componentMergeField="true">name</column>
<column componentMergeField="true">stagename</column>
</lineitemsSOQL>}}-->[/code]

This method requires adding the columnFields="true" attribute to your <component> tag to specify that your component template uses the fields that you define below in <column> tags. You must also define a merge field prefix within your <component> tags by using the mergeFieldPrefix="prefix" attribute. This prefix must be used in the merge fields in your component template. Each merge field used in your component must also be defined in a <column> tag with the componentMergeField="true" attribute in the parent template component query.

Refer to the section below to see a syntax example of how your merge fields should look in your component template when using method 2.

Create The Component Template

Now that we've written our LineItemsSOQL statement in the parent template, it's time to create the component template that will appear there when the parent template is generated.

Create a new S-Docs template, and ensure that the Related To Type field is set to the object that your SOQL query is pulling data from (in this case, Opportunity). Change the Template Format field to Component. This will automatically uncheck the Available For Use and Initially Visible checkboxes when you save the template, ensuring that users won't be able to select and generate this template on its own.

Navigate to the template editor. All you have to do now is build out how you want the data from each record to appear in the parent template.

For Method 1, you can simply use merge fields like you always would. We'll make a simple list of data that looks something like this:

[code lang="html"]Opportunity ID: {{!Opportunity.id}}
Opportunity Name: {{!Opportunity.name}}
Opportunity StageName: {{!Opportunity.stagename}}[/code]

For method 2, be sure to use the merge field prefix specified in the parent template, and only reference fields defined in the parent template component query <column> tags.

[code lang="html"]Opportunity ID: {{!prefix.id}}
Opportunity Name: {{!prefix.name}}
Opportunity StageName: {{!prefix.stagename}}[/code]

Once you click Save, you're ready to generate your document!

Note: For method 1, you can also reference the merge field {{!RowNum}} in your component template. This will correspond to the row number of the record returned by the LineItemsSOQL statement in the parent template.
For method 2, add a column in your parent template component query like <column componentMergeField="true">rownum</column> and then use {{!MergeFieldPrefix.rownum}} (Replacing MergeFieldPrefix with your chosen prefix)
Note 2: If you're using Named Queries in your parent template, you can reference these merge fields in your component template as well.
Note 3: Component templates support <nullprefix>, <nullpostfix>, <allprefix>, and <allpostfix> tags.

Generate Your Document

It's time to put our work into action. Navigate to a base object record (in this case, we'll be navigating to an Account record) and click the S-Docs button. Choose your parent template and click Next Step.

Once your document has generated, click the PDF icon to view it. The component template will have generated for each record in your list. Since our account had two opportunities attached to it, the component template generated twice in our parent template.

Although this is only a very simple example, you can use the full power of the S-Docs template editor to style both the component and parent template in any way that you want.


Top