Loading
Feature Degradation | Agentforce Voice Read More
Vlocity Contract Lifecycle Management
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Server-Side Document Generation Integration Procedures in CLM

          Server-Side Document Generation Integration Procedures in CLM

          The docGenerationSample/singleDocxServersideLwc Omniscript calls one of three Integration Procedures depending on its Service Function setting. Each of these Integration Procedures calls a different method of the DocumentServiceGateway Apex class by using different parameters.

          The generated document gets attached to the Notes & Attachments section under the Related tab of your object.

          Note
          Note When the server-side document generation is initiated, you will only see the jobId. Once the async document generation is successful, from the Response Text field on the DocumentGenerationProcess page you can retrieve the pdfContentVersionId.
          Important
          Important

          Server-Side document generation is only supported in customer orgs and it isn't enabled by default. To enable this feature, see Enable Server-Side Document Generation Setting for the Salesforce Industries Package.

          DocumentServiceGateway_DocGeneration Integration Procedure

          The docGenerationSample/singleDocxServersideLwc Omniscript calls the DocumentServiceGateway_DocGeneration Integration Procedure if its Service Function setting is Server Side Document Generation.

          This Integration Procedure invokes the generateDocument method of the DocumentServiceGateway Apex class. This method generates a .docx, .pptx, or .pdf document depending on the specified input parameters.

          The input that's passed to the method includes these parameters.

          Input Parameter

          Passed In

          Description

          objectId

          input

          ID of an object such as a Contract, Order, or Quote.

          templateId

          input

          Document Template ID.

          contextId

          input

          ID of an object such as a Contract, Order, or Quote.

          title

          options

          Optional title for the generated document.

          outputFileFormat

          options

          Output file format: either all, docx/pptx, or pdf.

          keepIntermediate

          options

          Indicates whether to keep the intermediate .docx or .pptx file when generating a .pdf output: either true or false.

          returnAsPdf

          options

          Indicates whether to generate a .pdf output: either true or false.

          The output that's passed back to the DocumentServiceGateway_DocGeneration Integration Procedure includes these parameters.

          Output Parameter

          Description

          docContentVersionId

          ID of the generated document in .docx or .pptx format.

          pdfContentVersionId

          ID of the generated document in .pdf format.

          isSuccessfulTransaction

          Indicates whether the Document Generation Process completed successfully: either true or false.

          errorMessage

          Error message if the Document Generation Process didn't complete successfully.

          jobId

          ID of the completed Document Generation Process

          example
          example

          DocGeneration Integration Procedure

          This image shows the Input Parameters that are passed to the method and the Output Parameters that are passed back to the DocumentServiceGateway_DocGeneration Integration Procedure.

          This image shows the Input Parameters that are passed to the method and the Output Parameters that are passed back to the DocumentServiceGateway_DocGeneration Integration Procedure.

          DocumentServiceGateway_DocGenerationWithTokenData Integration Procedure

          The docGenerationSample/singleDocxServersideLwc Omniscript calls the DocumentServiceGateway_DocGenerationWithTokenData Integration Procedure if its Service Function setting is Server Side Document Generation w/ Token Data.

          This Integration Procedure invokes the generateDocumentWithTokenData method of the DocumentServiceGateway Apex class. This method generates either a .docx, .pptx, or .pdf document depending on the specified input parameters and token data.

          The input that's passed to the method includes these parameters.

          Input Parameter

          Passed In

          Description

          objectId

          input

          ID of an object such as a Contract, Order, or Quote.

          templateId

          input

          Document Template ID.

          tokenDataMap

          input

          Sample data to use instead of data from the template's Omnistudio Data Mapper.

          title

          options

          Optional title for the generated document.

          returnAsPdf

          options

          Indicates whether to generate .pdf output: either true or false.

          keepIntermediate

          options

          Indicates whether to keep the intermediate .docx or .pptx file when generating a .pdf output: either true or false.

          outputFileFormat

          options

          Output file format: either all, docx/pptx, or pdf.

          The output that's passed back to the DocumentServiceGateway_DocGenerationWithTokenData Integration Procedure includes these parameters.

          Output Parameter

          Description

          docContentVersionId

          ID of the generated document in .docx or .pptx format.

          pdfContentVersionId

          ID of the generated document in .pdf format.

          isSuccessfulTransaction

          Indicates whether the Document Generation Process completed successfully: either true or false.

          errorMessage

          Error message if the Document Generation Process didn't complete successfully.

          jobId

          ID of the completed Document Generation Process.

          example
          example

          DocGenerationWithTokenData Integration Procedure

          This image shows the Input Parameters that are passed to the method and the Output Parameters that are passed back to the DocumentServiceGateway_DocGenerationWithTokenData Integration Procedure.

          This image shows the Input Parameters that are passed to the method and the Output Parameters that are passed back to the DocumentServiceGateway_DocGenerationWithTokenData Integration Procedure.

          DocumentServiceGateway_DocGenerationPDF Integration Procedure

          The docGenerationSample/singleDocxServersideLwc Omniscript calls the DocumentServiceGateway_DocGenerationPDF Integration Procedure if its Service Function setting is Server Side PDF Generation.

          This Integration Procedure invokes the convertToPDF method of the DocumentServiceGateway Apex class. This method generates a .pdf document based on either a previously generated .docx or .pptx document.

          The input that's passed to the method includes these parameters.

          Input Parameter

          Passed In

          Description

          objectId

          input

          ID of an object such as a Contract, Order, or Quote.

          contentVersionId

          input

          ID of the generated document to convert to .pdf.

          title

          options

          Optional title for the generated document.

          The output that's passed back to the DocumentServiceGateway_DocGenerationPDF Integration Procedure includes these parameters.

          Output Parameter

          Description

          pdfContentVersionId

          ID of the generated document in .pdf format.

          jobId

          ID of the completed Document Generation Process.

          title

          Title of the generated document.

          success

          Indicates whether the Document Generation Process completed successfully: either true or false.

          error

          Error message if the Document Generation Process didn't complete successfully.

          errorCode

          Error status code if the Document Generation Process didn't complete successfully. For example, INVOKE-200, and INVOKE-500.

          example
          example

          DocGenerationPDF Integration Procedure

          This image shows the Input Parameters that are passed to the method and the Output Parameters that are passed back to the DocumentServiceGateway_DocGenerationPDF Integration Procedure.

          This image shows the Input Parameters that are passed to the method and the Output Parameters that are passed back to the DocumentServiceGateway_DocGenerationPDF Integration Procedure.
           
          Loading
          Salesforce Help | Article