The fndSingleDocxServersideLwc Omniscript consists of steps, which run sequentially when the Omniscript is
invoked. Each step has properties that determine the action the step performs. If you
want to change the steps, Salesforce recommends that you either create a new version
or clone a copy of this Omniscript.
Omniscript Step
Properties
Script Configuration
Type —
docGenerationSample
SubType —
fndSingleDocxServersideLwc
EnterObject
ObjectId — The Salesforce Object ID, which is
assigned to the contextID later in the SetValues
step.
TemplateType — Either Microsoft
Word .DOCX Template or Microsoft PowerPoint .PPTX
Template.
GetDocumentTemplates
Invokes the ExtractDocumentTemplateByTemplateType
Omnistudio Data Mapper, which retrieves all active DOCX or PPTX document
templates.
PickTemplate
Displays the document templates in the clmSelectableItems
Lightning Web Component.
GenerationOptions
ServiceFunction — The type of document generation:
Server Side Document Generation (default), Server Side
Document Generation w/ Token Data (see the next step), Server
Side PDF Generation, or None.
OutputFileFormat — The document type of the output:
Word/PPT & PDF (default), Word/PPT,
PDF, or
None.
DocumentTitle — An
optional title for the generated document. Applies if
ServiceFunction is set to Server Side Document
Generation or Server Side Document Generation w/ Token
Data.
DocumentContentVersionId The
ID of a previously generated DOCX or PPTX document to be converted to PDF.
Applies if ServiceFunction is set to Server Side
PDF Generation.
To list previously generated DOCX and
PPTX documents, use the Developer Console to run a query like
this:
SELECT Id, Title FROM ContentVersion
SetGenerationServiceInputParams
Sets key-value pairs to be passed to one of the subsequent document
generation steps. Keys are selectedTemplate,
templateType, documentTitle,
docxContentVersionId, templateId,
objectId, outputFileFormat,
tokenDataMap, attachFileFormat,
downloadFileFormat, and contextId.
If
the ServiceFunction in the previous step is set to
Server Side Document Generation w/ Token Data, the
tokenDataMap is used instead of the Data Mapper associated with
the template. This key lets you test document generation with sample
data.
ServerSideDocGeneration
Performs document generation if ServiceFunction is
set to Server Side Document Generation. Invokes the
DocumentServiceGateway_DocGeneration Integration Procedure, which invokes the
DocumentServiceGateway Apex class.
When you define remote action to call a remote class, you must also specify the namespace. Remote class name format is <namespace>.<classname>, for example, omnistudio.DocumentServiceGateway.
ServerSideDocGenerationWithTokenData
Performs document generation if ServiceFunction is
set to Server Side Document Generation w/ Token Data. Invokes the
DocumentServiceGateway_DocGenerationWithTokenData Integration Procedure, which
invokes the DocumentServiceGateway Apex class.
When you define remote action to call a remote class, you must also specify the namespace. Remote class name format is <namespace>.<classname>, for example, omnistudio.DocumentServiceGateway.
ServerSidePdfGeneration
Performs document generation if ServiceFunction is
set to Server Side PDF Generation. Invokes the
DocumentServiceGateway_DocGenerationPDF Integration Procedure, which invokes
the DocumentServiceGateway Apex class.
When you define remote action to call a remote class, you must also specify the namespace. Remote class name format is <namespace>.<classname>, for example, omnistudio.DocumentServiceGateway.
ErrorHandling
Displays an error message if document generation was
unsuccessful.
ResponseMessage
Displays a JobId if the document generation job
completed successfully.
Did this article solve your issue?
Let us know so we can improve!
Loading
Salesforce Help | Article
Cookie Consent Manager
General Information
Required Cookies
Functional Cookies
Advertising Cookies
General Information
We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required Cookies
Always Active
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional Cookies
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising Cookies
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.