70
NOTE: This PDF is no longer being maintained. For the latest updates, please refer to our Community Portal . OneSpan Sign for Salesforce Integrator's Guide Date: January 28, 2020 Product Release: 5.0

OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

NOTE: This PDF is no longer being maintained. For the latest updates, please refer to our Community Portal.

OneSpan Sign for SalesforceIntegrator's Guide Date: January 28, 2020

Product Release: 5.0

Page 2: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

Copyright Notices

Copyright © 2019 OneSpan North America, Inc. All rights reserved.

Trademarks

OneSpan™, DIGIPASS® and CRONTO® are registered or unregistered trademarks of OneSpan North America Inc. and/or OneSpan International GmbH (collectively "OneSpan") in the U.S. and other countries.

OneSpan reserves all rights to the trademarks, service marks and logos of OneSpan and its subsidiaries.

All other trademarks or trade names are the property of their respective owners.

Intellectual Property

OneSpan Software, documents and related materials (“Materials”) contain proprietary and confidential information. All title, rights and interest in OneSpan Software and Materials, updates and upgrades thereof, including software rights, copyrights, patent rights, industrial design rights, trade secret rights, sui generis database rights, and all other intellectual and industrial property rights, vest exclusively in OneSpan or its licensors. No OneSpan Software or Materials may be downloaded, copied, transferred, disclosed, reproduced, redistributed, or transmitted in any form or by any means, elec-tronic, mechanical or otherwise, for any commercial or production purpose, except as otherwise marked or when expressly permitted by OneSpan in writing.

Disclaimer

OneSpan accepts no liability for the accuracy, completeness, or timeliness of content, or for the reliability of links to and content of external or third party websites or materials.

OneSpan shall have no liability under any circumstances for any loss, damage, or expense incurred by you, your com-pany, or any third party arising from the use or inability to use OneSpan Software or Materials, or any third party mater-ial made available or downloadable. OneSpan will not be liable in relation to any loss/damage caused by modification of these Legal Notices or content.

Reservation

OneSpan reserves the right to modify these Notices and the content at any time. OneSpan likewise reserves the right to withdraw or revoke consent or otherwise prohibit use of the OneSpan Software or Materials if such use does not con-form to the terms of any written agreement between OneSpan and you, or other applicable terms that OneSpan pub-lishes from time to time.

Contact us

Phone: 1-855-MYESIGNe-Mail: [email protected] Support: https://www.esignlive.com/customer-supportResource center: https://www.esignlive.com/resource-centerCompany Website: https://www.onespan.com

Date: January 28, 2020

Page 3: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

CONTENTS

1  Introduction 1

1.1  Document Audience 2

1.2  Document Organization 3

2  Creating OneSpan Sign Transactions Programmatically 4

2.1  Creating a Transaction from a Custom Button 5

2.2  Creating a Transaction from a Custom Action 9

2.3  Parameters for URL Code Snippets 13

3  Automation via OneSpan Sign Conventions 30

3.1  Positioning OneSpan Sign Fields via Text Tags 32

3.2  Updating Data via Field Mappings 42

3.3  Updating Fields Programmatically 48

4  Auto-Preparing Transactions 51

4.1  Auto-Preparing via the User Interface 52

4.2  Auto-Preparing Programmatically 53

4.3  Automatically Sending a Transaction 54

5  Working with Dynamic Doc-Creation Apps 55

5.1  Conga Composer 56

OneSpan Sign for Salesforce - Integrator's Guide

iii

Page 4: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

6  Connecting to a Private Cloud or On-Premises OneSpan Sign 59

7  Configuring a Government Instance of Salesforce 62

7.1  Prerequisites 63

7.2  Action 64

OneSpan Sign for Salesforce - Integrator's Guide

iv

Page 5: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

1 Introduction

This guide describes how to integrate the OneSpan Sign application with the Sales-force application. The guide's procedures enable:

 l The execution of certain actions programmatically

 l The customization of OneSpan Sign for Salesforce for your environment

1  IntroductionOneSpan Sign for Salesforce - Integrator's Guide

1

Page 6: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

1.1  Document AudienceThis guide's intended audience is Salesforce administrators and Salesforce developers. The developers should know JavaScript.

1  IntroductionOneSpan Sign for Salesforce - Integrator's Guide

2

Page 7: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

1.2  Document OrganizationThis rest of this guide discusses the following topics:

 1. Creating OneSpan Sign Transactions Programmatically on page 4

 2. Automation via OneSpan Sign Conventions on page 30

 3. Auto-Preparing Transactions on page 51

 4. Working with Dynamic Doc-Creation Apps on page 55

 5. Connecting to a Private Cloud or On-Premises OneSpan Sign on page 59

 6. Configuring a Government Instance of Salesforce on page 62

1  IntroductionOneSpan Sign for Salesforce - Integrator's Guide

3

Page 8: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

2 Creating OneSpan Sign Transactions Programmatically

OneSpan Sign for Salesforce enables you to create OneSpan Sign transactions pro-grammatically. There are two main ways of doing so:

 l Creating a Transaction from a Custom Button on page 5

 l Creating a Transaction from a Custom Action on page 9

The following section provides information relevant to both of the above procedures:

 l Parameters for URL Code Snippets on page 13

NOTE: The URL that appears in the code examples below must start with the character string /apex/esl__package?. This is the URL required to access a OneSpan Sign package's Visualforce page.

2  Creating OneSpan Sign Transactions ProgrammaticallyOneSpan Sign for Salesforce - Integrator's Guide

4

Page 9: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

2.1  Creating a Transaction from a Custom ButtonIf you create a Custom Button, and add it to a Salesforce object, the added button enables Salesforce users to send documents to be signed from that object’s records.

You can programmatically create a package from a Custom Button in three ways:

 l Creating a Transaction from a Template on page 5

 l Creating a Transaction from a Salesforce ID or an Email Address on page 6

 l Creating a Transaction from a Convention on page 8

2.1.1  Creating a Transaction from a TemplateTo create a package programmatically from a template:

 l Write and then run code that will create a package from a template.

You must specify the following template parameters:

 l ParentId

 l Name

 l TemplateId

At the end of this procedure, you should see all the template's information reflected in the created package.

Example

When the following code snippet is run, it creates a OneSpan Sign package from a template for a particular account:

/apex/esl__package?ParentId={!Account.Id}& Name={!Account.Name}%20Agreement &TemplateID=a0G360000018BdREAU  

2  Creating OneSpan Sign Transactions ProgrammaticallyOneSpan Sign for Salesforce - Integrator's Guide

5

Page 10: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

2.1.2  Creating a Transaction from a Salesforce ID or an Email Address

To create a package programmatically from a Salesforce ID or an email address:

 l Write and then run code that will create a OneSpan Sign package from a Sales-force ID or an email address.

You must specify the following parameters:

 l Name

 l SignerN — This can be either a Salesforce ID (see Example 1 on page 7) or an email address for the Nth recipient (see Example 2 on page 7). If SignerN is an email address, the following parameters are also required:

 l SignerNFirstName

 l SignerNLastName

 l Documents

NOTE: OneSpan Sign supports the following types of documents:

 l Adobe's Portable Document Format (*.pdf)

 l Microsoft Word (*.doc or *.docx)

 l Open Office (*.odt)

 l Text (.txt)

 l Rich Text Format (.rtf)

CAUTION: Please be aware of the following:

 l The maximum size of a single document is 16 MB. The only excep-tions concern our Salesforce and Microsoft SharePoint connectors,

2  Creating OneSpan Sign Transactions ProgrammaticallyOneSpan Sign for Salesforce - Integrator's Guide

6

Page 11: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

whose maximum is 5 MB per document. Smaller documents yield better performance — we recommend under 5 MB per document.

 l If you enable email delivery while configuring a recipient, doc-uments that are larger than 5 MB will not be added as attach-ments to the email.

 l OneSpan will not provide Technical Support for a transaction or transaction template that has more than 10 documents.

 l Document file names should not contain any of the following comma-separated characters: *, /, \, :, <, >, |, ?, ".

 l A document's name cannot contain the string esigned.

 l Uploading password-protected or corrupted documents will trigger an error.

 l PDFs added to a transaction must not have syntax errors. We strongly recommend that you scan a PDF for syntax errors before you add it to a transaction (e.g., by using Adobe's Preflight tool).

 l PDFs with the NeedAppearances flag set to true are not currently supported.

At the end of this procedure, you should see the provided information reflected in the created package.

Example 1

When the following code snippet is run, it creates a OneSpan Sign package from the ID of a contact:

/apex/esl__package?ParentId={!Account.Id}&Name={!Account.Name}%20Agreement&Signer1=00336000003gBYX&Documents=00P36000000wwrd

Example 2

When the following code snippet is run, it creates a OneSpan Sign package from an email address. In particular, this snippet creates a recipient of type External Email with the email address [email protected].

2  Creating OneSpan Sign Transactions ProgrammaticallyOneSpan Sign for Salesforce - Integrator's Guide

7

Page 12: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

/apex/esl__package?ParentId={!Account.Id}&Name={!Account.Name}%20Agreement&[email protected]&Signer1FirstName=john&Signer1LastName=doe&Documents=00P36000000wwrd

2.1.3  Creating a Transaction from a ConventionTo create a package from a Convention with the help of customized code:

 1. Create a suitable Convention (for more, see Automation via OneSpan Sign Con-ventions on page 30).

 2. Create a Custom button that will run the necessary code when the button is clicked (see the example below).

 3. Click the Custom button. Doing so should create a package with the inform-ation specified in the Convention.

Example

When the following code snippet is run, it creates a OneSpan Sign package from a Convention, where:

 l The ConventionId is the ID of the Convention to be used.

 l Signer1Label is the ID of the Recipient Label to be applied to Signer1.

/apex/esl__package?ParentId={!Account.Id}&Name={!Account.Name}%20Agreement&Documents=00P36000000wwrd&ConventionId=a0836000000nfRo&Signer1=00336000003gBYX&Signer1Label=a0K36000001j8VW

2  Creating OneSpan Sign Transactions ProgrammaticallyOneSpan Sign for Salesforce - Integrator's Guide

8

Page 13: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

2.2  Creating a Transaction from a Custom ActionIf you create a Custom Action, and add it to a Salesforce object, the added action enables Lightning Experience users to easily send documents to be signed via OneSpan Sign.

The URL used in the procedure for a Custom Action is the same as that for a Cus-tom Button, except that the URL for a Custom Action must be stored in a custom field created on the object.

To create a package programmatically via a Custom Action, perform the steps below:

 l Step 1: Create a field that will store the automation URL. on page 9

 l Step 2: Create a Visualforce page to trigger the automation. on page 9

 l Step 3: Create the action in the component, and associate the Visualforce page with it. on page 11

 l Step 4: Add the action to the Page Layout. on page 11

Step 1: Create a field that will store the automation URL.

In this step, you must create a field in the object (Account, Contact, Opportunity, etc) that will store the Automation URL. That URL follows the same rules as for the Custom Button, and it receives the same parameters.

We recommend using formula fields, so you can merge fields.

Step 2: Create a Visualforce page to trigger the automation.

In the Visualforce page, the Admin user must use a component supplied by the con-nector to: (1) read the Automation URL stored in the field created above; (2) trigger the automation.

To create the Visualforce page:

<apex:page standardController="Account">

 <ESL:PackageAutomation fieldName="Account_Automation_URL__c" />

2  Creating OneSpan Sign Transactions ProgrammaticallyOneSpan Sign for Salesforce - Integrator's Guide

9

Page 14: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

</apex:page>

 1. Click Setup.

 2. In the left pane, click Develop > Visualforce pages. A list of Visualforce pages appears.

 3. Click New.

 4. Type a suitable Label, Name, and Description for the new page.

 5. Select the Available for Salesforce mobile apps and Lighting Pages check box.

 6. On the Visualforce Markup tab, type the following code:

After the Admin user has created the Visualforce page, they must specify: (1) the name of the object that will use that page (e.g., Account, Contact, Opportunity, a custom object, etc.); (2) the name of the field where the URL is stored.

2  Creating OneSpan Sign Transactions ProgrammaticallyOneSpan Sign for Salesforce - Integrator's Guide

10

Page 15: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

Step 3: Create the action in the component, and associate the Visualforce page with it.

 1. Click Setup.

 2. If you want to use a standard object, in the left pane click Customize, and select the object.

 3. If you want to use a custom object:

 a. In the left pane, click Create > Objects. A new page displays a list of cus-tom objects.

 b. Find the relevant custom object, and click its name.

 4. In the Buttons, Links, and Actions section, click New Action. A New Action page opens.

 5. Under Action Type, select Custom Visualforce.

 6. Under Visualforce Page, select the Visualforce page you created earlier.

 7. Type a suitable Label and Name for the new Custom Action.

 8. Click Save.

Step 4: Add the action to the Page Layout.

Once the action has been created, the Admin user must add it to the Page Layout to make it accessible to other users. It must also be added to the Salesforce1 actions to make it available on mobile devices.

To add the new Custom Action to the Page Layout for your custom object:

 1. Click Setup.

 2. In the left pane, click Create > Objects. A new page displays a list of custom objects.

 3. Find your custom object, and click its name.

 4. On the Page Layouts section, click Edit. The Page Layout page appears.

 5. Click the Salesforce1 Actions option in the top left pane.

2  Creating OneSpan Sign Transactions ProgrammaticallyOneSpan Sign for Salesforce - Integrator's Guide

11

Page 16: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

 6. If you don't see any actions in the Salesforce1 and Lightning Experience Actions section, click the wrench icon that appears when you move your mouse over that section.

 7. Drag the new Custom Action into the Salesforce1 and Lightning Experience Actions section.

 8. Click Save.

At the end of this procedure, you should see all input information reflected in the created package.

2  Creating OneSpan Sign Transactions ProgrammaticallyOneSpan Sign for Salesforce - Integrator's Guide

12

Page 17: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

2.3  Parameters for URL Code SnippetsThe following table describes parameters that can be used in URL code snippets for all of the above procedures.

NOTE: A static sample has a fixed value. The value of a dynamic sample is specified by a merged field.

Para-

meter

Name

Descrip-

tionStatic Sample Dynamic Sample

TemplateId The package's template ID. If it's not provided, cre-ate it ad hoc. Any field spe-cified in the URL will over-ride the value of the tem-plate. The tem-plate must be active.

TemplateId=a0Ag0000007r4nS TemplateId=

{!Account.Transacti

on_Template__c}

Name The package's name, URL-encoded.

Name=My %20Transaction Name=

{!Contact.Name} 

%20Transaction

Description The package's description, URL-encoded.

Description=The 

%20Transaction 

%20Description

Description=

{!Contact.FirstNam

e} %20

{!Contact.LastNam

e}-The 

%20Transaction 

%20Description

ExpiryDate The package's expiration date (YYYYMMDD)

ExpiryDate=20151230 ExpiryDate=

{!Contact.ExpiryDat

e__c}

2  Creating OneSpan Sign Transactions ProgrammaticallyOneSpan Sign for Salesforce - Integrator's Guide

13

Page 18: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

Para-

meter

Name

Descrip-

tionStatic Sample Dynamic Sample

EmailMes-sage

Content of the email message

EmailMessage=Content %20of 

%20the %20email %20to 

%20send

EmailMessage=

{!Account.CustomEma

il__c}

Language Language of the package (only English is currently avail-able)

Language=en Language=

{!Contant.Communica

tionLanguage__c}

InPer-sonSigning

Flag that spe-cifies if in-per-son signing is true or false

InPersonSigning=true InPersonSigning=

{!Contact.InPersonS

igning__c}

Documents List of comma-separated IDs. Those IDs can be for Sales-force attach-ments, Salesforce doc-uments, or Salesforce files. Create a pack-age attach-ment, document, or file with its bin-ary, and with a related name that cor-responds to the item's order in the list. Note: Sales-force files

Documents=015g0000000Cm1f, 

00Pg0000001eg9H

Documents=

{!Account.DocumentI

d__c}

2  Creating OneSpan Sign Transactions ProgrammaticallyOneSpan Sign for Salesforce - Integrator's Guide

14

Page 19: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

Para-

meter

Name

Descrip-

tionStatic Sample Dynamic Sample

became sup-ported only in OneSpan Sign for Salesforce 4.10. Warning: The system supports a max-imum of 5 MB per doc-ument (smaller documents yield better per-formance — we recom-mend under 5 MB per doc-ument). The system sup-ports a max-imum of 10 documents per package or package tem-plate. However, there is no limit to the total collective size of doc-uments in a package.

Send Flag that indic-ates if the package must be sent after being created.

Send=1 or Send=true Send=

{!Account.Automatic

allySend__c}

2  Creating OneSpan Sign Transactions ProgrammaticallyOneSpan Sign for Salesforce - Integrator's Guide

15

Page 20: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

Para-

meter

Name

Descrip-

tionStatic Sample Dynamic Sample

Requires a default Con-vention or the conventionID parameter, and a Recipient Label for at least one of the recipients.

ConventionId The Con-vention ID that will be used to prepare and send the pack-age. Con-ventionId is mandatory if no default Con-vention has been set in the Custom Set-tings.

ConventionId=a0Rg00000033spu ConventionId=

{!Account.Conventio

n__c}

retUrl The URL to which users will be dir-ected once the package has been sent. It must have Send=1 or Send-d=true, and it must be URL-encoded.

retUrl= %2Fhome %2Fhome.jsp retUrl= %2F

{!Account.Id}

Descrip-tionOb-

Specifies the description of

DescriptionObjectName=Accoun

t& 

DescriptionObjectNa

me=Account& 

2  Creating OneSpan Sign Transactions ProgrammaticallyOneSpan Sign for Salesforce - Integrator's Guide

16

Page 21: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

Para-

meter

Name

Descrip-

tionStatic Sample Dynamic Sample

jectName a package, using the name of a cus-tom object. It must be an object name like Account or Transaction__c. This para-meter requires Descrip-tionOb-jectField and Descrip-tionObjectId.

DescriptionObjectField=Name& 

DescriptionObjectId=001g0000

00T9wTR

DescriptionObjectFi

eld=Name& 

DescriptionObjectId

={!Account.Id}

Descrip-tionOb-jectField

Specifies the description of a package, using a field from a custom object. Must be a field in the object defined in Descrip-tionOb-jectName, like Name or Description__c. This parameter requires Descrip-tionOb-jectName and Descrip-tionObjectId.

DescriptionObjectName=Accoun

t& 

DescriptionObjectField=Name& 

DescriptionObjectId=001g0000

00T9wTR

DescriptionObjectNa

me=Account& 

DescriptionObjectFi

eld=Name& 

DescriptionObjectId

={!Account.Id}

2  Creating OneSpan Sign Transactions ProgrammaticallyOneSpan Sign for Salesforce - Integrator's Guide

17

Page 22: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

Para-

meter

Name

Descrip-

tionStatic Sample Dynamic Sample

Descrip-tionObjectId

Specifies the description of a package, using a cus-tom object's ID. Must be the ID of an object of the type defined in Descrip-tionOb-jectName. This parameter requires Descrip-tionOb-jectName and Descrip-tionOb-jectField.

DescriptionObjectName=Accoun

t& 

DescriptionObjectField=Name& 

DescriptionObjectId=001g0000

00T9wTR

DescriptionObjectNa

me=Account& 

DescriptionObjectFi

eld=Name& 

DescriptionObjectId

={!Account.Id}

EmailMes-sageOb-jectName

Specifies the email message of a package, using the name of a cus-tom object. Must be an object name like Account or Transaction__c. This para-meter requires EmailMes-sageOb-jectField and EmailMes-

EmailMessageObjectName=Accou

nt& 

EmailMessageObjectField=Nam

e& 

EmailMessageObjectId=001g000

000T9wTR

EmailMessageObjectN

ame=Account& 

EmailMessageObjectF

ield=Name& 

EmailMessageObjectI

d={!Account.Id}

2  Creating OneSpan Sign Transactions ProgrammaticallyOneSpan Sign for Salesforce - Integrator's Guide

18

Page 23: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

Para-

meter

Name

Descrip-

tionStatic Sample Dynamic Sample

sageObjectId.EmailMes-sageOb-jectField

Specifies the email message of a package, using a field from a custom object. Must be a field in the object defined in EmailMes-sageOb-jectName, like Name or Description__c. This parameter requires EmailMes-sageOb-jectName and EmailMes-sageObjectId.

EmailMessageObjectName=Accou

nt& 

EmailMessageObjectField=Nam

e& 

EmailMessageObjectId=001g000

000T9wTR

EmailMessageObjectN

ame=Account& 

EmailMessageObjectF

ield=Name& 

EmailMessageObjectI

d={!Account.Id}

EmailMes-sageObjectId

Specifies the email message of a package, using the ID of a custom object. Must be the ID of an object of the type defined in EmailMes-sageOb-jectName. This parameter

EmailMessageObjectName=Accou

nt& 

EmailMessageObjectField=Nam

e& 

EmailMessageObjectId=001g000

000T9wTR

EmailMessageObjectN

ame=Account& 

EmailMessageObjectF

ield=Name& 

EmailMessageObjectI

d={!Account.Id}

2  Creating OneSpan Sign Transactions ProgrammaticallyOneSpan Sign for Salesforce - Integrator's Guide

19

Page 24: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

Para-

meter

Name

Descrip-

tionStatic Sample Dynamic Sample

requires EmailMes-sageOb-jectName and EmailMes-sageOb-jectField.

SignerX X is a number from 1 to infin-ity. The value can be a lead ID, contact ID, user ID, or an email address. If an email address is provided, the parameters Sign-erXFirstName and Sign-erXLastName are required.

Signer1=003g000000OLhpk or 

[email protected]

Signer1FirstName=John& 

Signer1LastName=Doe

Signer1=

{!Account.Main_

Contact__c} or 

Signer1=

{!Contact.Email}& 

Signer1FirstName=

{!Contact.FirstNam

e}& 

Signer1LastName=

{!Contact.LastName}

Sign-erXFirstName

Specifies the first name of the recipient at index X. It's available only for external email recip-ients.

[email protected]

Signer1FirstName=John& 

Signer1LastName=Doe

Signer1=

{!Contact.Email}& 

Signer1FirstName=

{!Contact.FirstNam

e}& 

Signer1LastName=

{!Contact.LastName}

Sign-erXLastName

Specifies the last name of the recipient at index X. It's

[email protected]

Signer1FirstName=John& 

Signer1LastName=Doe

Signer1=

{!Contact.Email}& 

Signer1FirstName=

{!Contact.FirstNam

2  Creating OneSpan Sign Transactions ProgrammaticallyOneSpan Sign for Salesforce - Integrator's Guide

20

Page 25: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

Para-

meter

Name

Descrip-

tionStatic Sample Dynamic Sample

available only for external email recip-ients.

e}& 

Signer1LastName=

{!Contact.LastName}

Sign-erXPhone

Specifies the phone number of the recipient at index X. It's available only for external email recip-ients.

[email protected]

Signer1FirstName=John& 

Signer1LastName=Doe& 

Signer1Phone=8675309

Signer1=

{!Contact.Email}& 

Signer1FirstName=

{!Contact.FirstNam

e}& 

Signer1LastName=

{!Contact.LastNam

e}& Signer1Phone=

{!Contact.Mobile}

SignerXLabel Specifies the Recipient Label asso-ciated with the recipient at index X. Must be the ID of the recipient-label object in the related Convention (the default Convention or the one spe-cified in Con-ventionId).

Signer1=003g000000OLhpk& 

Signer1Label=a0Tg0000001uMIf

Signer1=

{!Contact.Id}& 

Signer1Label=

{!Contact.Recipient

Label__c}

Sign-erXAl-lowDeleg-ation

Flag that determines if you will allow the original Recipient you identified to

Signer1=003g000000OLhpk&Sign

er1AllowDelegation=true

Signer1=

{!Contact.Id}&Signe

r1AllowDelegation=1

2  Creating OneSpan Sign Transactions ProgrammaticallyOneSpan Sign for Salesforce - Integrator's Guide

21

Page 26: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

Para-

meter

Name

Descrip-

tionStatic Sample Dynamic Sample

delegate someone else to sign the e-SignTrans-action™ on their behalf. Valid values are: 1 or 0, true or false.

If the value is 1 or true, the Recipient will be asked to enter the email address and full name of the delegate, plus an optional email message to be sent to the del-egate. You will be notified of this change of Recipient, and will be CC’d on the email mes-sage (if sent).

Sign-erXAuthMeth-od

Flag that allows you to create a trans-action auto-matically, using one of the following

Signer1=003g000000OLhpk&Sign

er1AuthMethod=sms

Signer1=003g000000OLhpk&Sign

er1AuthMethod=qaRecipient

1=003g000000OLhpk&Signer1Aut

hMethod=email

Signer1=

{!Contact.Id}&Signe

r1AuthMethod=

{!Contact.Authentic

ationMethod__c}

2  Creating OneSpan Sign Transactions ProgrammaticallyOneSpan Sign for Salesforce - Integrator's Guide

22

Page 27: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

Para-

meter

Name

Descrip-

tionStatic Sample Dynamic Sample

authentication methods:

 l Question and answer

 l SMS

 l Email

If question and answer is selec-ted as the authentication method, then the following additional para-meters must be configured:

 l sign-erXQandA-YQuestion – the authen-tication question

 l sign-erXQandA-YTex-tAnswer – the cor-rect answer to the authen-

2  Creating OneSpan Sign Transactions ProgrammaticallyOneSpan Sign for Salesforce - Integrator's Guide

23

Page 28: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

Para-

meter

Name

Descrip-

tionStatic Sample Dynamic Sample

tication question.

 l sign-erXQandA-YSFFieldA-nswer –an alternative method of defining the answer. In this case, the answer comes from a spe-cified field within the chosen type. For example, if using Contact as your Type, you could select any field within the Contact type, such as phone number.

2  Creating OneSpan Sign Transactions ProgrammaticallyOneSpan Sign for Salesforce - Integrator's Guide

24

Page 29: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

Para-

meter

Name

Descrip-

tionStatic Sample Dynamic Sample

The Recip-ient would then enter their phone number , which is cross-ref-erenced with the phone number field in their Contact type. Note that you can-not use this para-meter if SignerX is of External Email type. Note also that you need to provide either sign-erXQandA-YSFFieldA-nswer or sign-erXQandA-YTex-

2  Creating OneSpan Sign Transactions ProgrammaticallyOneSpan Sign for Salesforce - Integrator's Guide

25

Page 30: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

Para-

meter

Name

Descrip-

tionStatic Sample Dynamic Sample

tAnswer, but you cannot provide both.

 l sign-erXQandA-YMaskAn-swer – determ-ines whether or not the answer typed by the user should be masked while typ-ing. Poss-ible values are true and false. This para-meter is optional and defaults to false.

Note that X is the number of recipients and Y is

2  Creating OneSpan Sign Transactions ProgrammaticallyOneSpan Sign for Salesforce - Integrator's Guide

26

Page 31: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

Para-

meter

Name

Descrip-

tionStatic Sample Dynamic Sample

the num-ber of questions (up to 2 questions are sup-ported).

AutoPrepare Flag that determines if the AutoPre-pare feature will be activ-ated for a pack-age if a Convention is specified. Valid values are: 1 or 0, true or false.

AutoPrepare=true AutoPrepare=

{!Account.AutoPrepa

reTransaction__c} 

Insert=

{!Account.InsertVal

ueInTransaction__c}

 

Insert Flag that determines if data from Salesforce will be auto-pop-ulated into a OneSpan Sign document when the doc-ument's pack-age is being prepared. Valid values are: 1 or 0, true or false.

Insert=true Insert=

{!Account.InsertVal

ueInTransaction__c}

WriteBack Flag that determines if a Salesforce field

WriteBack=true WriteBack=

{!Account.WriteValu

eInTransaction__c}

2  Creating OneSpan Sign Transactions ProgrammaticallyOneSpan Sign for Salesforce - Integrator's Guide

27

Page 32: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

Para-

meter

Name

Descrip-

tionStatic Sample Dynamic Sample

will be updated with data from a OneSpan Sign document when that doc-ument's pack-age is completed. Valid values are: 1 or 0, true or false.

Enfor-ceSign-ingOrder

Flag that determines if the enforce signing order condition is true or false.

EnforceSigningOrder=true EnforceSigningOrder

=

{!Account.EnforceSi

gningOrder__c}

ParentId ID of the par-ent object. To be stored in the ParentId text field. It automatically populates the parent type and the related lookup field if possible.

ParentId=001g000000T9wTR ParentId=

{!Account.Id}

enableRe-minders

Flag (true / false) that determines if the automatic-reminder fea-ture is set for the package

enableReminders=true enableReminders=

{!Account.Reminders

Enabled__c}

2  Creating OneSpan Sign Transactions ProgrammaticallyOneSpan Sign for Salesforce - Integrator's Guide

28

Page 33: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

Para-

meter

Name

Descrip-

tionStatic Sample Dynamic Sample

sendRe-minderDays

Number of days before the first reminder is sent

sendReminderDays=2 sendReminderDays=

{!Account.SendRemin

derDays__c}

repeatRe-minderDays

Interval in days between suc-cessive remind-ers

repeatReminderDays=1 repeatReminderDays=

{!Account.RepeatRem

inders__c}

totalRe-minders

Maximum num-ber of remind-ers to be sent

totalReminders=10 totalReminders=

{!Account.TotalRemi

nders__c}

Chat-terEnable

Flag (true / false) that determines if Chatter will be active on the package

ChatterEnable=true ChatterEnable=

{!Account. 

ChatterEnable __c}

2  Creating OneSpan Sign Transactions ProgrammaticallyOneSpan Sign for Salesforce - Integrator's Guide

29

Page 34: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

3 Automation via OneSpan Sign Conventions

An OneSpan Sign Convention is defined by the fact that it contains one or more of the following types of objects:

 l Text Tags — A Text Tag is an object that can insert a OneSpan Sign field (e.g., Street Address) at particular positions in multiple documents for multiple recip-ients.

 l Field Mappings — A Field Mapping is an object that enables the following fea-tures:

 l Insert — This feature copies a value of a Salesforce field (e.g., Street Address) into a corresponding field of a OneSpan Sign document when a transaction is being prepared. That data can then be retrieved from the signed document. The data in ques-tion can be either data about a recipient, or data about a Sales-force "related object".

NOTE: The relevant OneSpan Sign field must exist before you can insert a Salesforce value into it. You can create the required OneSpan Sign field by using a Text Tag.

 l Writeback — This feature copies a value of a OneSpan Sign field (e.g., First Name) into a corresponding Salesforce field. Using it, data entered by recipients during the Signing Cere-

3  Automation via OneSpan Sign ConventionsOneSpan Sign for Salesforce - Integrator's Guide

30

Page 35: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

mony can be written back into Salesforce fields, based on Field Mappings defined when the transaction is completed.

NOTE: The Writeback feature is disabled by default.

A Convention can be defined by users with OneSpan Sign Template Admin per-missions.

OneSpan Sign Conventions can be used to perform the following kinds of tasks:

 l Positioning OneSpan Sign Fields via Text Tags on page 32

 l Updating Data via Field Mappings on page 42

 l Updating Fields Programmatically on page 48

3  Automation via OneSpan Sign ConventionsOneSpan Sign for Salesforce - Integrator's Guide

31

Page 36: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

3.1  Positioning OneSpan Sign Fields via Text TagsA selected Convention's Text Tag can be used to insert a OneSpan Sign field at par-ticular positions in multiple documents for multiple recipients.

In fact, three types of Text Tags can be used for this purpose:

 l Positioning Fields at Static Positions on page 33

 l Positioning Fields via Text Anchors on page 35

 l Positioning Fields via PDF Form Fields on page 39

CAUTION: Before creating any of the above Text Tag types, ensure that each Recipient Label has at least one Text Tag of type Signature (Full Name, Initials, Capture, or Mobile Capture). If a Recipient Label doesn’t have any Text Tags, the OneSpan Sign package cre-ated with that label could be corrupted.

CAUTION: When a Text Tag inserts an object in a document, that object overwrites and thus obscures any preexisting content in that place.

3  Automation via OneSpan Sign ConventionsOneSpan Sign for Salesforce - Integrator's Guide

32

Page 37: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

TIP: You can use Text Tags with the Auto-Prepare feature to automatically prepare entire OneSpan Sign transactions for sending (see Auto-Preparing Transactions on page 51).

3.1.1  Positioning Fields at Static PositionsThe following procedure illustrates how to use the Static Position Text Tag to insert OneSpan Sign fields at static positions (fixed X-Y coordinates) in multiple doc-uments for multiple recipients.

To insert a OneSpan Sign field at a static position in multiple documents for mul-tiple recipients:

 1. Create a new Convention, and save it.

 2. On the Convention Detail page, click New OneSpan Sign Recipient Label.

 3. Give the Recipient Label a name, and then click Save.

 4. Click New Text Tag to create a Text Tag in the Recipient Label.

 5. On the New Text Tag page, select Static Position from the drop-down list, and give the Text Tag a name.

 6. Type values for the Text Tag'sTop Offset and Left Offset.

NOTE: This step specifies the field's fixed position on a page. The next step specifies the page on which the OneSpan Sign field will appear.

 7. Specify the Page number on which the Text Tag should appear.

NOTE: Pages are counted sequentially from the first to the last doc-ument in the package.

 8. Specify the Width and Height of the OneSpan Sign field you want to create.

3  Automation via OneSpan Sign ConventionsOneSpan Sign for Salesforce - Integrator's Guide

33

Page 38: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

 9. In the OneSpan Sign Field Name section, choose the desired Type from the drop-down list. Then click Save.

 10. Create a new OneSpan Sign package, and add your Convention to the package.

 11. On the OneSpan Sign Transaction page, click Advanced Options.

 12. In the OneSpan Sign Convention field, select Lookup.

 13. Choose the Convention created above, and add documents to the package.

 14. Add recipients to the package, and assign each recipient a Recipient Label from the drop-down list.

NOTE: If at this step you choose the Recipient Label created above, the field created above will appear for that recipient.

3  Automation via OneSpan Sign ConventionsOneSpan Sign for Salesforce - Integrator's Guide

34

Page 39: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

 15. Click Prepare to see the Derecipient. Verify that the field defined in the Con-vention has been inserted properly in each document for each relevant recip-ient. Once you're satisfied with the results, you can close the Derecipient, and then click Send to send the package.

3.1.2  Positioning Fields via Text AnchorsThe following procedure illustrates how to use the Text Anchor Text Tag to insert OneSpan Sign fields in multiple documents for multiple recipients.

Fields will be inserted at the positions of the Text Anchors.

NOTE: Text Anchors are available for both Microsoft Word documents and PDF doc-uments.

3  Automation via OneSpan Sign ConventionsOneSpan Sign for Salesforce - Integrator's Guide

35

Page 40: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

To use Text Anchors to insert a OneSpan Sign field in multiple documents for two recipients:

 1. Create a new Convention, and save it.

 2. On the Convention Detail page, click New OneSpan Sign Recipient Label.

 3. Give a name to the Recipient Label, and then click Save. This Recipient Label is for the first recipient.

 4. Click New Text Tag to create a Text Tag in the Recipient Label.

 5. On the Text Tag page, choose Text Anchor from the Field Type drop-down list, and give the Text Tag a name.

 6. Fill in the Text field with the exact string to be searched for in the uploaded documents.

NOTE: If the exact text string cannot be found in an uploaded document, OneSpan Sign will trigger an error and then delete the document from the package.

 7. Add the Character Index within the Text Anchor. It will be used to calculate the position of the field.

 8. Add the Occurrence of the search string. For example, a value of 2 will skip the first two occurrences of the anchor text, and use the third occurrence to cal-culate the position.

3  Automation via OneSpan Sign ConventionsOneSpan Sign for Salesforce - Integrator's Guide

36

Page 41: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

 9. Specify a Top Offset and Left Offset for the field's position relative to the rel-evant anchor text. Each offset can be positive, negative, or zero.

 10. Specify the Width and Height of the desired OneSpan Sign field.

 11. Under the OneSpan Sign Field Name, choose Signature as the desired type from the drop-down list. Then click Save.

 12. Repeat Steps 2-11 for the second recipient. The following image illustrates how the resultant Signature Blocks may appear at the end of this procedure.

 13. Create another Text Anchor for the signing date, with the Text Anchor being the first occurrence of DATE.

 14. Create a Recipient Label for the second recipient, and within it create two Text Tags. The first is for the signature, using WITNESS SIGNATURE as the anchor text. The second is for the signing date, using the second occurrence of DATE.

3  Automation via OneSpan Sign ConventionsOneSpan Sign for Salesforce - Integrator's Guide

37

Page 42: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

 15. Create a new OneSpan Sign package. You must give the package a name.

 16. On the OneSpan Sign package page, click Advanced Options.

 17. In the OneSpan Sign Convention field, select Lookup.

 18. Choose the created Convention.

 19. Add documents and recipients to the package, and assign each recipient a Recipient Label from the drop-down list.

NOTE: If at this step you choose a Recipient Label created above, the field created above will appear for that recipient.

 20. Click Prepare to open the Derecipient. Verify that the Signature Blocks and signing dates defined above have been properly inserted. You can then close the Derecipient, and click Send to send the package.

3  Automation via OneSpan Sign ConventionsOneSpan Sign for Salesforce - Integrator's Guide

38

Page 43: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

3.1.3  Positioning Fields via PDF Form FieldsThe following procedure illustrates how to use the PDF Form Field Text Tag to insert OneSpan Sign fields in multiple documents for multiple recipients.

The PDF Form Fields already have fixed positions in the relevant PDF, and the OneSpan Sign fields will be placed in the PDF Form Fields.

To use PDF Form Fields to insert a OneSpan Sign field in multiple documents for multiple recipients:

 1. Verify that the relevant PDF document has at least one PDF Form Field.

 2. Create a new Convention, and save it.

 3. On the Convention Detail page, click New OneSpan Sign Recipient Label.

 4. Give the Recipient Label a name, and then click Save.

 5. Click New Text Tag to create a Text Tag in the Recipient Label.

 6. On the Text Tag page, select PDF Form Field from the drop-down list.

 7. Give the Text Tag a name, and fill in the Form Field Name with the name of the PDF Form Field from the PDF.

3  Automation via OneSpan Sign ConventionsOneSpan Sign for Salesforce - Integrator's Guide

39

Page 44: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

 8. On the OneSpan Sign Field Name, select the field type from the drop-down list (e.g., signature, auto-fill signed date, input text field). Then click Save.

 9. Create a new OneSpan Sign package. You must give the package a name.

 10. On the OneSpan Sign package page, click Advanced Options.

 11. In the OneSpan Sign Convention field, select Lookup, and choose the Con-vention created above.

 12. Add documents and recipients to the package, and assign each recipient a Recipient Label from the drop-down list.

3  Automation via OneSpan Sign ConventionsOneSpan Sign for Salesforce - Integrator's Guide

40

Page 45: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

NOTE: If at this step you choose a Recipient Label created above, the field created above will appear for that recipient.

 13. Click Prepare to open the Derecipient. Verify that the signature and signing date defined above have been properly inserted at the positions of the pre-exist-ing PDF Form Fields. You can then close the Derecipient, and click Send to send the package.

3  Automation via OneSpan Sign ConventionsOneSpan Sign for Salesforce - Integrator's Guide

41

Page 46: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

3.2  Updating Data via Field MappingsA Field Mapping is an object that enables the following features:

 l Insert — This feature copies a value of a Salesforce field (e.g., Street Address) into a corresponding field of a OneSpan Sign document when a package is being prepared. That data can then be retrieved from the signed document. The data in question can be either data about a recipient, or data about a Sales-force "related object".

NOTE: The relevant OneSpan Sign field must exist before you can insert a Salesforce value into it. You can create the required OneSpan Sign field by using a Text Tag.

 l Writeback — This feature copies a value of a OneSpan Sign field (e.g., Street Address) into a corresponding Salesforce field. Using it, data entered by recip-ients during the Signing Ceremony can be written back into Salesforce fields, based on Field Mappings defined when the package is completed.

NOTE: The Writeback feature is disabled by default.

The rest of this section describes:

 l Inserting Salesforce Recipient Data into OneSpan Sign Fields on page 42

 l Inserting Salesforce Related-Object Data into OneSpan Sign Fields on page 44

 l Updating Salesforce Fields with OneSpan Sign Data (Writeback) on page 47

3.2.1  Inserting Salesforce Recipient Data into OneSpan Sign FieldsThe following procedure illustrates how to insert into OneSpan Sign documents Salesforce data from a recipient's record (e.g., data about a Salesforce user, contact, or lead).

In particular, it describes how to insert into a OneSpan Sign package the address of a Salesforce contact who is also a recipient.

3  Automation via OneSpan Sign ConventionsOneSpan Sign for Salesforce - Integrator's Guide

42

Page 47: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

To insert a Salesforce contact’s address into a OneSpan Sign package:

Creating a Convention

 1. Click the Conventions tab.

 2. Click New.

 3. Enter a name for the new Convention, and click Save.

Creating a Field Mapping

 4. On the Field Mapping related list, click New Field Mapping, and give a name to the mapping.

 5. In the Mapping Type drop-down list, select Recipient.

 6. In the OneSpan Sign Document Field Reference section, give the OneSpan Sign field name.

 7. In the Salesforce Object Field Reference section, click Add new.

 8. Choose the desired object. In this case, the object is Contact. A list of the con-tact’s fields appears on the right.

 9. Choose the field to be mapped to a OneSpan Sign field (e.g., the contact's City), and then click Add.

NOTE: Ensure that the Insert option is checked when the field is added. This will enable the system to insert data from the Salesforce object’s field into the OneSpan Sign documents.

 10. Click Save to save the Field Mapping.

 11. Repeat Steps 4-10 to create a new Field Mapping for each address field (City, Zip Code, etc.).

Creating a Transaction and Inserting Salesforce Data into It

3  Automation via OneSpan Sign ConventionsOneSpan Sign for Salesforce - Integrator's Guide

43

Page 48: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

 12. Create a OneSpan Sign package (giving it a name), and then click the Advanced Options tab.

 13. On the OneSpan Sign Convention section, click Lookup and choose the Con-vention created above.

 14. Click the Details tab.

 15. From the Related object type drop-down menu, choose Account (if it is not already selected).

 16. Add documents to the package, and add the contact as a recipient.

 17. Click Prepare. The Derecipient appears in a dialog box.

 18. Add a Signature Block for the contact.

 19. To display more options, click the gear icon on the right side of the Signature Block. Then click the + sign to add fields. The list of available fields appears.

 20. Click text field to add a text field.

 21. To display more options, click the gear icon on the right side of the text field. Then click Settings to see the field settings.

 22. Give a name to the Convention Field Names, which are displayed on the left side of the Derecipient. Then click Save.

 23. Repeat Steps 19-22 for each of the Convention's fields.

 24. When finished, close the overlay and click Send.

The package will be sent. When the package is complete, its signed doc-uments should contain the contact's address. Thanks to this procedure, that address in OneSpan Sign documents will have been inserted directly from Sales-force.

3.2.2  Inserting Salesforce Related-Object Data into OneSpan Sign Fields

The following procedure illustrates how to insert into OneSpan Sign documents Salesforce data from a record linked to a OneSpan Sign package object.

3  Automation via OneSpan Sign ConventionsOneSpan Sign for Salesforce - Integrator's Guide

44

Page 49: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

In particular, it describes how to insert an address from an Account record into a OneSpan Sign package.

To insert a Salesforce Account’s address into a OneSpan Sign package:

Creating a Convention

 1. Click the Conventions tab.

 2. Click New.

 3. Enter a name for the new Convention, and then click Save.

Creating a Field Mapping

 4. On the Field Mapping related list, click New Field Mapping, and give a name to the mapping.

 5. In the Mapping Type drop-down list, select Related object.

 6. In the OneSpan Sign document field reference section, give the OneSpan Sign field name.

 7. In the Salesforce Object Field Reference section, click Add New.

 8. Choose the desired object. In this case, the object is Account. A list of the Account’s fields appears to the right.

 9. Choose the field to be mapped (e.g., the Account's City), and then click Add.

NOTE: Ensure that the Insert option is checked when the field is added. This will enable the system to insert data from the Salesforce object’s field into the OneSpan Sign documents.

 10. Click Save to save the Field Mapping.

 11. Repeat Steps 4-10 to create a new Field Mapping for each address field (City, Zip Code, etc.).

Creating a Transaction and Inserting Salesforce Data into It

3  Automation via OneSpan Sign ConventionsOneSpan Sign for Salesforce - Integrator's Guide

45

Page 50: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

 12. Create a OneSpan Sign package (giving it a name), and click the Advanced Options tab.

 13. On the Conventions field, click Lookup and choose the Convention created above.

 14. Click the Details tab.

 15. From the Related object type drop-down menu, choose Account (if it is not already selected).

 16. Click Lookup to choose the Account record.

 17. Add documents to the package, and add recipients to the package.

 18. Click Prepare. The Derecipient page appears. Add your Signature Blocks.

 19. To display more options, click the gear icon on the right side of the Signature Block. Then click the + sign to add fields.

 20. Click Settings to see the field settings. The list of available fields appears.

 21. Click Text Field to add a text field.

 22. To display more options, click the gear icon on the right side of the text field.

 23. Type the name of the desired Convention field name. These field names are dis-played on the left side of the overlay. Then click Save.

 24. Repeat Steps 19-23 for each Convention field.

 25. Close the Derecipient. Then click Send to send the package. When the package is complete, its signed documents should contain the Account's address. With this procedure, the address will be inserted into OneSpan Sign documents dir-ectly from Salesforce.

3  Automation via OneSpan Sign ConventionsOneSpan Sign for Salesforce - Integrator's Guide

46

Page 51: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

3.2.3  Updating Salesforce Fields with OneSpan Sign Data (Writeback)

A Field Mapping's Writeback feature can update data in Salesforce fields from OneSpan Sign documents.

For example, suppose that: (1) a recipient notices during the Signing Ceremony that his address is wrong in a OneSpan Sign package document; (2) the recipient cor-rects his address in that document.

If that OneSpan Sign address is mapped to a field of a Salesforce related object, and the Writeback option has been checked for that mapping, when the OneSpan Sign package is complete, the updated address will be written into the Salesforce field.

NOTE: The data to be written back into Salesforce must be entered during the Signing Ceremony.

To update a Salesforce field with data from a OneSpan Sign document when the associated package is completed:

 1. Select the Writeback option for the associated Field Mapping.

 2. When the OneSpan Sign package is complete, verify that the data updated dur-ing the Signing Ceremony appears in the associated Salesforce field.

3  Automation via OneSpan Sign ConventionsOneSpan Sign for Salesforce - Integrator's Guide

47

Page 52: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

3.3  Updating Fields ProgrammaticallyAfter a OneSpan Sign Convention has been created, users who create transactions manually can use the Convention to automate certain tasks. Instead of having to perform those tasks manually, having them performed automatically saves users time.

Specifically, users can run programs to automatically: 

 l Position OneSpan Sign fields in multiple documents for multiple recipients via Text Tags

 l Update OneSpan Sign fields with Salesforce data via Field Mappings (the Insert feature)

 l Update Salesforce fields with OneSpan Sign data via Field Mappings (the Write-back feature)

The following sections describe how to do these things:

 l Updating OneSpan Sign Fields on page 48

 l Updating Salesforce Fields (Writeback) on page 49

3.3.1  Updating OneSpan Sign FieldsThe Insert feature copies a value of a Salesforce field (e.g., First Name) into a cor-responding field of a OneSpan Sign document when a package is being prepared. That data can then be retrieved from the signed document. The data in question can be either data about a recipient, or data about a Salesforce "related object".

To use a program to automatically insert data from the Salesforce database into an input field in a OneSpan Sign document:

 1. Write code that will: (a) create the package; (b) attach to the package a suit-able Convention, suitable documents, suitable recipients, etc.

NOTE: If your Convention contains Text Tags, fields will automatically be created and positioned inside OneSpan Sign documents.

3  Automation via OneSpan Sign ConventionsOneSpan Sign for Salesforce - Integrator's Guide

48

Page 53: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

 2. Add to that code the following URL parameter: "Insert=1" OR "Insert=true". Your code should resemble the following example:

/apex/esl__package?ParentId={!Account.Id}&Name={!Account.Name}%20Agreement&      Documents=00P36000000wwrd&ConventionId=a0836000000nfRo&    Signer1=00336000003gBYX&Signer1Label=a0K36000001j8V&Insert=1

Here:

 l Signer1Label is the SalesforceId of the Recipient Label to be applied to Signer1.

 l The ConventionId is the SalesforceId of the Convention to be used.

 3. Create a Custom Button that will run that code. Once that button is clicked, you should see all inserted Salesforce data in the created package.

3.3.2  Updating Salesforce Fields (Writeback)A Field Mapping's Writeback feature can automatically update data in Salesforce fields from OneSpan Sign documents.

For example, suppose that: (1) a recipient notices during the Signing Ceremony that his address is wrong in a OneSpan Sign package document; (2) the recipient cor-rects his address in that document.

If that OneSpan Sign address is mapped to a field of a Salesforce related object, and the Writeback option has been checked for that mapping, when the OneSpan Sign package is complete, the updated address will be written into the Salesforce field.

NOTE: The data to be written back into Salesforce must be entered during the Signing Ceremony.

3  Automation via OneSpan Sign ConventionsOneSpan Sign for Salesforce - Integrator's Guide

49

Page 54: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

To use a program to update a Salesforce field with data from a OneSpan Sign doc-ument when the associated package is completed:

 1. Write code that will: (a) create the package; (b) attach to the package a suit-able Convention, suitable documents, suitable recipients, etc.

NOTE: If your Convention contains Text Tags, fields will automatically be created and positioned inside OneSpan Sign documents.

 2. Add to that code the following URL parameter: "Writeback=1" OR "Write-back=true". Your code should resemble the following example:

/apex/esl__package?ParentId={!Account.Id}&Name={!Account.Name}%20Agreement&

Documents=00P36000000wwrd&ConventionId=a0836000000nfRo&

Signer1=00336000003gBYX&Signer1Label=a0K36000001j8V&Writeback=1

Here:

 l Signer1Label is the SalesforceID of the Recipient Label to be applied to Signer1.

 l The ConventionId is the SalesforceID of the Convention to be used.

 3. Create a Custom Button that will run that code. Once that button is clicked, after the OneSpan Sign package is complete, the data updated during the Sign-ing Ceremony should appear in the associated Salesforce field.

3  Automation via OneSpan Sign ConventionsOneSpan Sign for Salesforce - Integrator's Guide

50

Page 55: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

4 Auto-Preparing Transactions

The Auto-Prepare feature enables users to automatically prepare a OneSpan Sign package for sending. When Auto-Prepare is activated on a package, the Send but-ton appears automatically on the package page. Thus the package can be sent through a single click on that button, without clicking Prepare.

The Auto-Prepare feature saves time for end-users because clicking Prepare inaug-urates a time-consuming process (the Recipient page opens, documents and recip-ients must be added manually, etc.).

There are two ways of activating the Auto-Prepare feature:

 l Auto-Preparing via the User Interface on page 52

 l Auto-Preparing Programmatically on page 53

This chapter also describes how to take automation one step further by auto-matically sending a package:

 l Automatically Sending a Transaction on page 54

4  Auto-Preparing TransactionsOneSpan Sign for Salesforce - Integrator's Guide

51

Page 56: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

4.1  Auto-Preparing via the User Interface

4.1.1  Prerequisite l The relevant OneSpan Sign package must have a Convention with a Recipient

Label. This in turn implies the presence of at least one of the following Text Tag types: static position, text anchor, or PDF form field.

4.1.2  ActionTo activate the Auto-Prepare feature for a package via the User Interface:

 l On the package's Advanced Options tab, check the field Auto-prepare with text tags. The Send button should now appear on the package page.

4  Auto-Preparing TransactionsOneSpan Sign for Salesforce - Integrator's Guide

52

Page 57: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

4.2  Auto-Preparing Programmatically

4.2.1  Prerequisite l The relevant OneSpan Sign package must have a Convention with a Recipient

Label. This in turn implies the presence of at least one of the following Text Tag types: static position, text anchor, or PDF form field. This in turn implies that the parameters ConventionId and RecipientNLabel must be specified.

4.2.2  ActionTo activate the Auto-Prepare feature for a package programmatically:

 1. Write code that will: (a) create the package; (b) attach to the package a suit-able Convention, suitable documents, suitable recipients, etc.

 2. Add to that code the following URL parameter: “AutoPrepare=1” OR “AutoPrepare=true”. Your code should resemble the following example:

/apex/esl__package?ParentId={!Account.Id}&Name={!Account.Name}%20Agreement&      Documents=00P36000000wwrd&ConventionId=a0836000000nfRo&    Signer1=00336000003gBYX&Signer1Label=a0K36000001j8V&AutoPrepare=1

 3. Create a Custom button that will run that code. Once that button is clicked, the package will be created, and the Send button should appear on the pack-age page.

4  Auto-Preparing TransactionsOneSpan Sign for Salesforce - Integrator's Guide

53

Page 58: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

4.3  Automatically Sending a TransactionThe following procedure uses a program to automatically send a package once the package has been created.

To automatically send a package once it's created:

 1. Write code that will: (a) create the package; (b) attach to the package a suit-able Convention, suitable documents, suitable recipients, etc.

 2. Add to that code the following URL parameter: “Send=1” OR “Send=true”. Your code should resemble the following example:

/apex/esl__package?ParentId={!Account.Id}&Name={!Account.Name}%20Agreement&      Documents=00P36000000wwrd&ConventionId=a0836000000nfRo&    Signer1=00336000003gBYX&Signer1Label=a0K36000001j8V&Send=1

 3. Create a Custom button that will run that code. Once that button is clicked, the package will automatically be sent after it is created.

4  Auto-Preparing TransactionsOneSpan Sign for Salesforce - Integrator's Guide

54

Page 59: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

5 Working with Dynamic Doc-Creation Apps

By leveraging the Auto-Prepare feature of OneSpan Sign, various third-party applic-ations can automatically create and distribute sophisticated third-party documents after populating their rich templates with Salesforce data.

That data can come either from Salesforce's standard or custom objects, or from external Data Sources via Lightning Connect.

5  Working with Dynamic Doc-Creation AppsOneSpan Sign for Salesforce - Integrator's Guide

55

Page 60: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

5.1  Conga ComposerConga Composer is one of the third-party applications referenced above. It imports Salesforce data by means of a Salesforce Custom Button.

The procedure below describes how to integrate Conga with OneSpan Sign for Sales-force in order to create exactly such a Custom Button in a Salesforce contact object.

When an end-user clicks that button:

 1. A document will be created with Conga.

 2. That document will be attached to the relevant Salesforce record.

 3. a OneSpan Sign package will be created, and the document will be attached to it.

 4. Signature Blocks for two recipients will be created in the document (via a suit-able Convention and Recipient Labels).

 5. The package will be sent.

5.1.1  Prerequisites  l You know how to create a OneSpan Sign package programmatically (see Creat-

ing OneSpan Sign Transactions Programmatically on page 4).

5.1.2  ActionTo create a Custom Button that can interact with Conga in the manner described above:

 1. Go to Setup > App Setup > Create > Objects.

 2. Select the OneSpan Sign Transaction object.

 3. In the Buttons, Links and Actions section of the OneSpan Sign Transaction Object page, click New Button or Link.

 4. Choose a display type for the button you want to create. There are three pos-sible types:

5  Working with Dynamic Doc-Creation AppsOneSpan Sign for Salesforce - Integrator's Guide

56

Page 61: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

 l Page Link — Creates a link that you can add to the links sec-tion of any Detail page. Links can display other pages or web-sites.

 l Page Button — Creates a button that you can add to the head-ing of any Detail page. Detail-page buttons act on the record that the user is viewing.

 l List Button — Creates a button that you can add to the head-ing of any list view or related list. List buttons enable users to select multiple items in a list, and to act on all of them at once.

TIP: To add list buttons to a related list, edit its properties on the page layout where the related list for an OneSpan Sign package appears.

 5. Select Behavior: Execute JavaScript and Content Source: OnClick JavaScript.

 6. Write and run a variation of the following sample JavaScript code. To make the code work, you must replace its placeholders for Salesforce's Id parameters.

{!REQUIRESCRIPT("/soap/ajax/30.0/connection.js")}   var ParentObjectId = '{!Contact.Id}';   var TransactionName = '{!Contact.Name} CongaPOC';   var RecipientId = '{!Contact.Id}';   var Send = true;   var congaParameters =   "SessionId={!API.Session_ID}&ServerUrl={!API.Partner_Server_URL_210}   &Id={!Contact.Id}&TemplateId=00P11000002ImxI&ds7=5&defaultPDF=1&OCNR=1";   //Change popup visual here   var popup =    window.open("https://composer.congamerge.com?" + congaParameters,   'Conga','menubar=no,scrollbars=no,top=100,left=100,width=300,height=200');   //Do not modify below this line   var timer = setInterval(function() {   if(popup.closed) {   clearInterval(timer);

5  Working with Dynamic Doc-Creation AppsOneSpan Sign for Salesforce - Integrator's Guide

57

Page 62: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

   var attach =    sforce.connection.query("select id from attachment where ParentId ='"    + ParentObjectId+"' order by createddate desc limit 1");   if(attach.records != null) {   var packageParameters =    'ParentId='+ParentObjectId   + '&Name='+TransactionName+'&Documents=' + attach.records.Id   + '&Signer1=' + RecipientId + '&Signer2=' + '0031100000eKoFW'   + '&ConventionId=a0711000003AGvj'   + '&Signer1Label=a0L110000035S7k'   + '&retURL={!URLENCODE(Contact.Id)}';   if(Send) {   packageParameters += '&Send=1';   }   window.location = '/apex/esl__package?' + packageParameters;   }    else {   window.reload();   }   } }, 500);

The above procedure creates a powerful Custom Button within Salesforce. By click-ing it, an end-user triggers the following sequence of events:

To verify the above procedure, certify that the document created by Conga is in the created package. If the inserted Salesforce data does not appear in that document, the responsibility lies with Conga.

5  Working with Dynamic Doc-Creation AppsOneSpan Sign for Salesforce - Integrator's Guide

58

Page 63: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

6 Connecting to a Private Cloud or On-Premises OneSpan Sign

Most installations of Salesforce that host OneSpan Sign for Salesforce use one of the public cloud domains listed in Environment URLs and IP Addresses.

If you want to use any other domain name, such as a private cloud or an on-premises deployment, then you must perform the following procedure.

To enable OneSpan Sign for Salesforce to work with a custom domain name for OneSpan Sign:

 1. Go to Setup > App Setup > Create > Apps.

 2. Under Connected Apps, click New.

 3. Under Basic Information, fill in the following fields:

 l Connected App Name

 l API Name

 l Contact email

 4. Under API (Enable OAuth Settings), check the option Enable OAuth Settings.

 a. Fill in the Callback URL as follows:

 i. For Sandbox: https://<custom domain name>/oauth2/salesforcetest

6  Connecting to a Private Cloud or On-Premises OneSpan SignOneSpan Sign for Salesforce - Integrator's Guide

59

Page 64: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

 ii. For Production: https://<custom domain name>/oauth2/salesforce

 b. Select OAuth Scope, and choose:

 i. Full access

 ii. Perform requests on your behalf at any time (refresh_token, offline_access)

 5. Under Canvas App Settings:

 a. Select the field Force.com Canvas.

 b. Fill in the Canvas App URL: https://<custom domain name>/

 c. For Access Method, choose OAuth Webflow (GET).

 d. For Locations, choose Visualforce.

 e. Click Lookup to set the Lifecycle Class as CanvasAppLifecycle.

 6. Click Save.

 7. After saving the connected app, a Consumer Key and Consumer Secret is cre-ated.

 8. The Consumer Key and Consumer Secret must be added as OAuth keys resources to the OneSpan Sign database.

 9. Go to Setup > App Setup > Develop > Custom Settings.

 10. On the Custom Settings page, next to OneSpan Sign Configuration, click Man-age.

 11. Next to the Default configuration, click Edit. The OneSpan Sign Configuration Edit page appears.

 12. Fill in the Custom Canvas App Name parameters with the API name of the new Connected App.

 13. Click Save.

6  Connecting to a Private Cloud or On-Premises OneSpan SignOneSpan Sign for Salesforce - Integrator's Guide

60

Page 65: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

At this point, your deployment should be complete. You can verify that it is by: (1) connecting your Salesforce application to your OneSpan Sign account; (2) creating and sending a package.

NOTE: The above procedure creates a new canvas application on Salesforce.

6  Connecting to a Private Cloud or On-Premises OneSpan SignOneSpan Sign for Salesforce - Integrator's Guide

61

Page 66: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

7 Configuring a Government Instance of Salesforce

Government organizations that use Salesforce often have special security needs. If so, they characteristically use the Salesforce instances na21 (for Production envir-onments) and cs32 (for Sandbox environments). Such deployments of OneSpan Sign for Salesforce will not be complete until the following procedure has been per-formed.

7  Configuring a Government Instance of SalesforceOneSpan Sign for Salesforce - Integrator's Guide

62

Page 67: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

7.1  Prerequisites  l All other deployment procedures have been performed (see the OneSpan Sign

for Salesforce Deployment Guide).

7  Configuring a Government Instance of SalesforceOneSpan Sign for Salesforce - Integrator's Guide

63

Page 68: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

7.2  Action If your Salesforce organization resides on a na21 or cs32 instance as stated in the Salesforce URL, do the following to complete your deployment:

 1. On the menu bar, click your User Name > Setup.

 2. Under Administration Setup, click Security Controls > Session Setting. A new page appears.

7  Configuring a Government Instance of SalesforceOneSpan Sign for Salesforce - Integrator's Guide

64

Page 69: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

 3. Under Session Settings, clear the check box Lock sessions to the IP address from which they originated. Then click Save.

 4. In the menu bar, click your User Name > Setup .

 5. Under Administration Setup, click Security Controls > Remote Site Settings. The All Remote Sites page appears.

 6. Click New Remote Site. The Remote Site Edit page appears. Add your instance settings to the remote site settings.

 7. Type the Remote Site Name.

 8. Type the Remote Site URL for your organization.

 9. Ensure that the Active check box is selected.

 10. Click Save.

 11. Once the Salesforce application is connected, the Salesforce Administrator must contact our Support Team to further configure the custom instance. The customer will be required to provide the Consumer Key and the Consumer Secret from the Custom ESL page.

7  Configuring a Government Instance of SalesforceOneSpan Sign for Salesforce - Integrator's Guide

65

Page 70: OneSpan Sign for Salesforce - Integrator's Guide · Step 2: Create a Visualforce page to trigger the automation. In the Visualforce page, the Admin user must use a component supplied

At this point, your deployment should be complete. You can verify that it is by: (1) connecting your Salesforce application to your OneSpan Sign account; (2) creating and sending a package.

7  Configuring a Government Instance of SalesforceOneSpan Sign for Salesforce - Integrator's Guide

66