DocGen & eSign

Developer Guide

Overview

This collection of developer guides provides technical documentation for building integrations, automations, and custom workflows with DocGen & eSign. It covers the data model, Apex classes, configuration scripts, document generation patterns, eSignature workflows, and automation options available for extending the application programmatically.

If you're looking for click-through installation and configuration steps instead, see the Admin Guide.

Core Data Model

DocGen & eSign's core functionality is built around Document Workflows, Document Templates, generated documents, and eSignature recipients.

The application provides Salesforce objects and relationships that support the complete document lifecycle:

  • Document template configuration

  • Document generation

  • Merge field processing

  • Generated document management

  • Document workflow creation

  • eSignature recipient configuration

  • Signing order and recipient sequencing

  • Signature field mapping

  • Document status and signing lifecycle

  • Completed and signed document management

The core records are related to the Salesforce source record from which the document generation or eSignature workflow is initiated.

Schema Model


Apex Automation

DocGen & eSign workflows can be initiated directly from Apex.

Use Apex when the workflow requires custom business logic, conditional document generation, dynamic signer configuration, or integration with other Salesforce processes.

Common use cases include:

  • Automatically generating documents after record creation.

  • Sending documents when a record reaches a specific status.

  • Dynamically determining signers.

  • Creating sequential signing workflows.

  • Generating multiple documents.

  • Sending generated documents for eSignature.

  • Starting document workflows from integrations or asynchronous Apex.

How to create a Document Workflow using apex


Key Apex Classes

These are the classes referenced during setup and integration work:

Site Guest User (external-facing) access:

  • docgen_esign.AutoPopulatedSigningScreenController

  • docgen_esign.CreateRecordScreenController

  • docgen_esign.SigningScreenController

  • docgen_esign.ViewSignCertificateController

Admin/configuration scripts (run from Developer Console → Execute Anonymous):

  1. Scripts to add credentials :

String sEnvironment = '<<< YOUR Environment >>>';
String siteLicenseKey = '<<< YOUR Site License Key >>>';
String vfPageKey = '<<< YOUR Vf Page License Key >>>';
String privateKey = '<<< YOUR  Private Key >>>';
docgen_esign.AdminServices.saveDocGenCredentials(sEnvironment, privateKey, siteLicenseKey, vfPageKey);


Please contact the setup@cloudmaveninc.com team to get your license key information.