| Show: | ||||
DocumentDataHandler
Signature
global with sharing class DocumentDataHandler
DocumentDataHandler Properties
DocumentDataHandler Methods
addDocConfigOverride(cv, customerDocumentConfigId)
Add an override file that will be used instead of the DocConfig template. eg a DOCX file
Signature
global static void addDocConfigOverride(ContentVersion cv, String customerDocumentConfigId)
Parameters
cv
Type:
ContentVersion
ContentVersion sObject of the ContentVersion that represents the override document
customerDocumentConfigId
Type:
String
The long Id, not the SFDC Id of the DocConfig
Returns
void
Example
addDocConfigOverride(base64, customerDocumentConfigId)
Add an override file that will be used instead of the DocConfig template. eg a DOCX file
Signature
global static void addDocConfigOverride(Blob base64, String customerDocumentConfigId)
Parameters
base64
Type:
Blob
Blob with the override document
customerDocumentConfigId
Type:
String
The long Id, not the SFDC Id of the DocConfig
Returns
void
Example
addDocConfigOverride(base64, customerDocumentConfigId, filename)
Signature
global static void addDocConfigOverride(Blob base64, String customerDocumentConfigId, String filename)
addDynamicAttachment(attachmentId)
Adds a PDF File from attachments to the generation. This PDF can be glued after the generated PDF
Signature
global static void addDynamicAttachment(Id attachmentId)
Parameters
Id
AttachmentId of the PDF file to add
Returns
void
Example
addDynamicBlob(fileName, pdf)
Adds a PDF File to the request. This PDF can be glued after the generated PDF
Signature
global static void addDynamicBlob(String fileName, Blob pdf)
Parameters
fileName
Type:
String
name of file
pdf
Type:
Blob
Blob from the pdf to add
Returns
void
Example
addDynamicFile(contentDocumentId)
Adds a PDF File from FILES to the generation. This PDF can be glued after the generated PDF
Signature
global static void addDynamicFile(Id contentDocumentId)
Parameters
Id
ContentDocumentId of the PDF file to add
Returns
void
Example
addDynamicFileThroughUrl(url, fileName)
Downloads a PDF and adds it to the generation. This PDF can be glued after the generated PDF. The file content will not be retrieved in APEX but will be downloaded by PDF Butler backend preventing to hit SFDC limits. This code can be run in a BEFORE Actionable or in APEX before the convert request is done
Signature
global static void addDynamicFileThroughUrl(String url, String fileName)
Parameters
url
Type:
String
Download Url of the PDF
fileName
Type:
String
Optional, leave empty if the filename of the downloaded file has to be used or choose your own filename
Returns
void
Example
addDynamicFileWithoutContent(contentDocumentId)
Adds a PDF File from FILES to the generation. This PDF can be glued after the generated PDF. The file content will not be retrieved in APEX but will be downloaded by PDF Butler backend
Signature
global static void addDynamicFileWithoutContent(Id contentDocumentId)
Parameters
Id
ContentDocumentId of the PDF file to add
Returns
void
Example
addPicklistDependency(parentPicklist, childPicklist, valueDependencies)
Add a picklist dependency. This is used to add a dependency between picklists.
Signature
global static void addPicklistDependency(String parentPicklist, String childPicklist, Map<String, List<String>> valueDependencies)
Parameters
childPicklist
Type:
String
The mergefield name of the child picklist to add the dependency to
parentPicklist
Type:
String
The mergefield name of the parent picklist that will be used to run the dependency
Returns
void
Example
generate(docConfigId, targetId, inputMap)
Low level method to convert DocConfig into a document. This will not run any Actionables!
Signature
global static DocGenerationWrapper generate(Id docConfigId, String targetId, Map<String, Object> inputMap)
Parameters
docConfigId
Type:
Id
Salesforce Id of the DocConfig to convert
targetId
Type:
String
Record Id that initiates the convert eg an Opportunity record
inputMap
Type:
Map<String, Object>
This map must at least have the key "recordId" that has the same value as the targetId
Returns
DocGenerationWrapper Wrapper object that contains all convert information, including the document
Example
generate(docConfigIds, targetId, inputMap)
Low level method to convert DocConfig into a document. This will not run any Actionables!
Signature
global static DocGenerationWrapper generate(List<Id> docConfigIds, String targetId, Map<String, Object> inputMap)
Parameters
docConfigIds
Type:
List<Id>
List of DocConfig Ids
targetId
Type:
String
Record Id that initiates the convert eg an Opportunity record
inputMap
Type:
Map<String, Object>
This map must at least have the key "recordId" that has the same value as the targetId
Returns
DocGenerationWrapper Wrapper object that contains all convert information, including the document
Example
generate(docConfigIds, targetId, inputMap, jsonInput)
Signature
global static DocGenerationWrapper generate(List<Id> docConfigIds, String targetId, Map<String, Object> inputMap, String jsonInput)
|
||||