How to attach a related invoice PDF to a source record?
Depending on your specific org setup, possible license restrictions or other reasons, you may have to attach produced invoice PDF files to the related source records, like opportunities, contracts, etc.
To do so, proceed as follows:
-
Create an ID field on the invoice that points to the source object.
If you generate invoices from opportunities, for example, you can create a
Lookup
field with the API nameON_Opportunity__c
that points toOpportunity
.For help about creating fields, see Managing Object Fields.
-
Create a new File Distribution custom setting, providing the API name of the ID field as the
Backend
value.For help about creating File Distribution settings, see File Distribution.
-
Create and finalize an invoice for the source record, or regenerate the PDF copy of an existing invoice.
JustOn now attaches the PDF copy of the invoice to the source record, accessible in the Notes & Attachments section.