Defining Custom File Name Scheme
← Controlling File Distribution
Assume your business wants to define a specific naming scheme for the PDF files produced when finalizing invoices, account statements or dunning reminders.
To this end, you create a dedicated File Distribution setting that specifies the intended naming pattern in the field PDF Name
.
Note
Be aware that the custom setting PDF Name does not modify the file names for the regular PDF file generation on invoice or statement finalization. This setting is used to determine the name for PDF files subject to the ZIP download.
To create the File Distribution setting:
-
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.
The mandatory information for defining a naming pattern include the name, the backend, the PDF name and the activation marker.
Assuming you want to modify the name of a produced invoice PDF file, keeping it in the default location, create this setting record:
Field Value Backend Invoice
Name InvoicePDFname
PDF Name [AccountName]_Invoice_[InvoiceNo].pdf
Active true
-
Click Save.
Applying this setting will produce invoice PDFs with a name like
JustOn_Invoice_201700018.pdf
, located on Salesforce's Files tab in the group Owned by me, and link the files with the corresponding invoice records.
Backend
concepts
Generally, the File Distribution field Backend
specifies the file distribution target.
Targets can be
- target records in your Salesforce org (
Invoice
orAccount
) that will be linked with the produced PDF files - cloud storage services (
GoogleDrive
orAmazonS3
) for storing produced documents - existing libraries and folders in Salesforce Files
As a specific backend use case, you can define the API name of an ID field (master-detail, lookup, formula) on the invoice that links to a specific object, for example, ON_Opportunity__c
or ON_Contract__c
. On PDF generation, JustOn links the file with the record referred to by the ID.