Updating Fields Programmatically

After 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: 

  • Position OneSpan Sign fields in multiple documents for multiple recipients via Text Tags
  • Update OneSpan Sign fields with Salesforce data via Field Mappings (the Insert feature)
  • Update Salesforce fields with OneSpan Sign data via Field Mappings (the Writeback feature)

The following sections describe how to do these things:

Updating OneSpan Sign Fields

The Insert feature copies a value of a Salesforce field (e.g., First Name) 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 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 suitable Convention, suitable documents, suitable recipients, etc.
  2. If your Convention contains Text Tags, fields will automatically be created and positioned inside OneSpan Sign documents.

  3. Add to that code the following URL parameter: "Insert=1" OR "Insert=true". Your code should resemble the following example:
  4. /apex/esl__package?ParentId={!Account.Id}&Name={!Account.Name}%20Agreement&
    			Documents=00P36000000wwrd&ConventionId=a0836000000nfRo&
    		Signer1=00336000003gBYX&Signer1Label=a0K36000001j8V&Insert=1

Here:

  • Signer1Label is the SalesforceId of the Recipient Label to be applied to Signer1.
  • The ConventionId is the SalesforceId of the Convention to be used.
  1. 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.

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 corrects 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.

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

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

  1. Write code that will: (a) create the package; (b) attach to the package a suitable Convention, suitable documents, suitable recipients, etc.
  2. If your Convention contains Text Tags, fields will automatically be created and positioned inside OneSpan Sign documents.

  3. Add to that code the following URL parameter: "Writeback=1" OR "Writeback=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:

  • Signer1Label is the SalesforceID of the Recipient Label to be applied to Signer1.
  • The ConventionId is the SalesforceID of the Convention to be used.
  1. 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 Signing Ceremony should appear in the associated Salesforce field.
Was this information helpful?
X