How to Install DocXpert
Create Button
Document Generation Options
Metaprovider
SOQL Query
Custom Fields
Insert images
Format
Date/Currency conversion
General Template Functions
How to Install DocXpert
Create Button
How to Create the Button
- Navigate to the object by clicking on
Setup → Object Manager → Your Object (ex. Opportunity)
Note: You may need to activate your object before continuing to the next step.
- In the menu on the left side of your screen, click “Buttons, Links, and Actions” then
the “New Action” button in the upper right hand corner of the window.
Enter the necessary information and click “Save”.
- Put the newly created lightning action on your page layout(s).a. On your object in the Object Manager (the window you see after clicking
“Save” in Step 3), click the “Page Layouts” link on the left side of the screen.
Note: If you clicked out of your object, simply go back by clicking
Setup → Object Manager → Your Object
- Click Mobile & Lightning Actions and search for your newly created lightning
actions in the Quick Find box - Click and drag the action down to the “Salesforce Mobile and Lightning
Experience Actions” section on the page layout.
Note: It can only be added to this section! If the Salesforce Mobile and Lightning Experience Actions sections looks as it does below, first click the “override the predefined actions” link. Then you can add your newly created action as shown.
- Repeat these steps for all layouts on which you would like to have the
Document Creator Button. - Set up your sharing settings on your Document Template object to make the
appropriate template(s) available for your users. Please see the Set Up User Access
section for more information.
Document Generation Options
Metaprovider
SOQL Query
Custom Fields
Insert images
To insert an image, use the IMAGE function. Please be aware that all images must be saved under the Files tab. For more information visit the Before you Begin: Images section in this user’s guide.
Before including the image function in your merge document, be sure of the following:
- The image is uploaded and saved to your “Files” tab.
- A Document Data Provider for that image has been created. See the “Document Data Provider” section in the Administration Guide for how to create a Document Data Provider.
- The name of the Document Data Provider is included in your query at the top of your merge document. Otherwise the image function will fail.
Note: Please note that all functions are case sensitive!
The syntax for the image function is as follows:
{IMAGE getImageContent(DataProvider.Id)}
Note: The ContentDocument ID is required for all images. No other ID is accepted by the template engine. Therefore, please be sure to use the ContentDocument ID, not the ContentVersion ID.
Note: To store an image on your record, such as a product image on your product record, write the ContentDocumentID in a custom text field. This is a workaround, since a lookup to an image is not currently possible in Salesforce. To find the SalesforeID of the image, navigate to your image in Salesforce, click on “View File Details”, and find the ID in the URL, as shown here:
To configure this workaround:
- Create a custom field (a field “ProductPicture__c” on your Product object, for example). Be sure to make this field editable and put on the appropriate page layout for the person responsible for adding the images to the records.
- Upload the image to your Files tab as described in the “Before You Begin: Images” section of the Administration Guide.
- Copy the Salesforce ID, navigate to your record, and enter the Images picture ID in the field.
- Save the record.
- Repeat steps 2-4 for each record which should have an image.
- Now you can reference the image in a merge field using this syntax:
{IMAGE getImageContent(lineItem.Product2.ProductPicture__c)}
In our quote example, it includes the $ symbol, because it is included in a loop and looks like this:
This example shows the Product picture for a Quote Line Items loop. To learn more about loops in your merge template, read the following section on the FOR() function.
Format
Date/Currency conversion
General Template Functions
Template function | Example usage |
Generate the current day | {today()}
complex example: {convertDateToLocale(today(),’en_US‘,’America/New_York‘)} |
Repeat a string | {repeatString(„.“, 5)} |
Length of a string | {length(Quote.BillingCity)} |
UpperCase a string | {toUpperCase(quote.BillingCity)} |
LowerCase a string | {toLowerCase(quote.BillingCity)} |