Enabling Draft PDF Generation
← Configuring Draft Editing Options
For review or testing purposes, your business may require that users generate PDF files from multiple invoices in the status Draft
.
Setting up this feature involves two tasks:
- Creating a file distribution target for draft invoices
- Adding the Create Draft PDFs button to the invoices list view or the invoice run detail view
Creating Draft PDF File Distribution Target
To enable the option for creating PDF files for draft invoices, create a dedicated file distribution target for draft PDF documents:
-
Click to enter Setup, then open Custom Settings.
In Salesforce Lightning, navigate to Custom Code > Custom Settings.
In Salesforce Classic, navigate to Develop > Custom Settings.
-
Click Manage in the row of File Distribution.
- Click New.
-
Specify the details as necessary.
Make sure to select the checkbox
Draft Folder
. Other mandatory information include the name, backend and PDF name.Assume you want to store PDF files for draft invoices in a dedicated library or folder in Salesforce Files:
Documents
↳ DraftsCreate a setting record like:
Field Value Name Draft invoice PDF
Active true
Backend Folder
Draft Folder true
Path Documents/Drafts
PDF Name [AccountName]_Draft_[InvoiceNo].pdf
-
Click Save.
Applying this setting will allow storing produced draft PDF files using the specified name pattern in Salesforce Files under
Documents/Drafts
.
Adding Create Draft PDFs Button
To enable the option for creating PDF files for multiple draft invoices from the invoices list view, add the Create Draft PDFs button to the invoices list view. To do so:
- Navigate to the object management settings of the Invoice object.
- Click List View Button Layout.
- In the List View row, click to open the action menu, then select Edit.
-
Under Custom Buttons, move
Create Draft PDFs
to the Selected Buttons column. -
Click Save to save the modified page layout.
To enable the option for creating PDF files for multiple draft invoices from the invoice run detail view, add the Create Draft PDFs button to the invoice run detail view. To do so:
- Navigate to the object management settings of the Invoice Run object.
- Click Page Layouts.
- Click Edit in the row of the Invoice Run Layout.
- Scroll to the Invoices list and click to open the list properties.
- Open the Buttons section.
-
Under Custom Buttons, move
Create Draft PDFs
to the Selected Buttons column. -
Click OK to save the list properties.
-
Click Save to save the modified page layout.
For help about modifying page layouts, see Managing Pages.