Loading
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
          Using the docGenerationSample/singleDocxLwc Omniscript

          Using the docGenerationSample/singleDocxLwc Omniscript

          This Omniscript generates one document from your Microsoft Word DOCX document templates or your Microsoft PowerPoint PPTX document templates. You enter the Object ID, pick a template, select different options for generating, and CLM generates the document.

          Note
          Note

          This feature is available for ​Salesforce Industries Communications, Media, and Energy Spring '20 and higher users only.

          You can use this Omniscript, which is a Salesforce Lightning Web Component, as a starting point for your own custom Omniscript. If you want to customize it, clone the existing version and make your changes to that Omniscript.

          You can add this Omniscript to different objects, not just contracts. You can use this Omniscript for other objects like quotes, orders, or opportunities. For example, you can add it to the Quotes page to easily access it from there.

          Or, you can add this LWC to your own Omniscripts, and create a step to include it.

          If you don’t see the docGenerationSample/singleDocxLwc Omniscript available in Vlocity Templates, import and activate it. Click the upper-right dropdown arrow and select Install DocGenerationSampleLwc.

          Important
          Important

          Unlike other CLM Omniscripts, you must activate the docGenerationSample/singleDocxLwc Omniscript before you can preview it. You preview this Omniscript in the LWC Preview tab.

          Lightning Web Components used in this Omniscript

          For details on each LWC, click the name in the following list:

          Omniscript Steps

          1. Enter Object ID and Template Type

            You enter the object ID, such as the contract ID and select the document template type.

            You can only choose a Microsoft Word DOCX or Microsoft PowerPoint PPTX document template.

            Illustrates the Enter Object Id Omniscript step.
          2. Pick a Template

            Select the name of your document template.

            Illustrates the Pick a template Omniscript step.
          3. Generation Options

            Select different download, attach, generation, and Data Mapper options. For setting up these options and the details, see Generation Options in the Omniscript Structure. Or if you clear all these fields, the Omniscript uses the org-level settings.

            Download File Format File format to download

            Attach File Format File format to attach

            Document Viewer Setting that displays a preview of the generated document or a thumbnail (Microsoft Word icon)

            Doc Generation Mechanism Source of the document generation

            Pdf Generation Source Source of the PDF generation

            Use Template DRExtract? Whether you want to use values extracted from the associated template or do you want to provide data

            Illustrates the Generation Options Omniscript step.
          4. View Your Generated Document

            You can email the generated document or PDF if you've set up the email address list.

            Illustrates the Generate Document Omniscript step.

          Omniscript Structure

          • Script Configuration

            When you select the Enable LWC check box, you can see the code necessary to embed this LWC in your own code:

            The component tag is <c-doc-generation-sample-single-docx-lwc-english></c-doc-generation-sample-single-docx-lwc-english>
          • EnterObject

            ObjectID: This captures the Salesforce ID of the object on which the document is generated. This ObjectId is used in the SetValues step to set the contextID.

            Important
            Important

            Vlocity requires the ObjectId parameter for document generation, and you must assign a value.

            TemplateType: This Omniscript supports only DOCX or PPTX template types, so you can’t change these values.

          • GetDocumentTemplates

            The DocGenSample-ExtractDocumentTemplatesLWC Data Mapper extracts all the templates with the Microsoft Word DOCX or Microsoft PPTX document template type. Click the link next to the Data Mapper field if you want to edit the Data Mapper filters based on your requirements.

          • PickTemplate

            This component displays the list of templates and is created from the clmSelectableItems LWC. You’re required to define the following parameters for this LWC:

            template-list: Displays the list of templates from the extract results of the Data Mapper.

            clear-state-on-change: Clears the previously selected template if the user goes back in the Omniscript because they want to change their previous selection.

          • SetValues

            You’re required to define the following parameters for this LWC because they’re necessary for document generation.

            contextId Salesforce Object ID for which the document is needed. If not available, the LWC looks for contextId or ContextId in the Omniscript's Data JSON, so you must define one of these items.

            selectedTemplate Select the document template data from the previous step.

            templateType The only options are Microsoft Word DOCX or Microsoft PowerPoint PPTX document templates. The LWC uses templateType from the Omniscript DataJSON, and if it doesn’t exist, the LWC gets it from the Template Query.

          • GenerationOptions

            attachFileFormat What are the file formats you want to attach?

            • None (default)

            • PDF

            • DOCX

            • PPTX

            • DOCX, PDF (both DOCX and PDF are attached)

            • PPTX, PDF (both PPTX and PDF are attached)

            documentViewer How do you want to view the generated document?

            • VlocityClientSideViewer (displays preview of document)

            • None (displays thumbnail, which is a Microsoft Word icon)

            docGenerationMechanism What does the LWC use to generate the document? VlocityClientSide is the only option because Vlocity Cloud is for beta users only.

            pdfGenerationSource Where does the LWC use to generate the PDF? VlocityClientSide is the only option.

            downloadFileFormat What are the file formats you want to download?

            • all (default)

            • word (only Microsoft Word files)

            • ppt (only Microsoft PPT files)

            • pdf (only PDF files)

            • none (Download button is hidden)

            useTemplateDRExtract Do you want to use the Data Mapper in the template or do you want to provide data extracted within the Omniscript?

            • Yes Token values are extracted from the Data Mapper associated with the template you're using.

            • No Token values need to be available in Omniscript data and mapped in the template's Data Mapper. You must make sure that all the token mapping of that Data Mapper in the template is mapped with the Omniscript data.

          • Set Generation Options

            The Omniscript sets the options that you defined in the GenerationOptions step.

          • Generate Document

            GenerateDocumentWord The clmOsDocxGenerateDocument LWC generates documents and attaches them to the object. Documents using DOCX templates are stored in Content Version. The list of documents is available in the Notes & Attachments section on the Related tab of the page. The Type is File for documents because they are stored in Content Version.

            EmailWordDocument Define the email address lists and your email content if you want to send the documents in email after generating them.

            Illustrates the Generate Document Omniscript step configuration.
            Note
            Note

            The action is controlled by a isWordAttachDone boolean (true/false). The LWC publishes this boolean to the Omniscript after the document is generated and attached. If document generation fails, the action won’t be displayed.

            EmailPDFDocument Define the email address lists and your email content if you want to send the document in email after generating them.

            Note
            Note

            The action is controlled by a isPDFAttachDone boolean (true/false). The LWC publishes this boolean to the Omniscript after the document is generated and attached. If document generation fails, the action won’t be displayed.

           
          Loading
          Salesforce Help | Article