Iāve added a couple of custom fields to the Invoice module and want to include them in an Invoice PDF template. When I add them to the template nothing appears. It seems this is not the correct method; can someone tell me how itās done?
Thanks in advance.
Hi @127bit1,
to include custom fields in an Invoice PDF template in SuiteCRM, you need to follow these steps:
- In Studio, go to the Invoice module and open the layout editor for the Detail View.
- Add the custom fields to the layout and save the changes.
- Go to Admin > Repair > Quick Repair and Rebuild and run the repair.
- Go to Admin > Repair > PDF Templates and run the repair.
- Go to Admin > PDF Templates and open the template you want to edit.
- In the template editor, use the syntax $invoice.field_name to include the custom fields in the template.
For example, if you added a custom field called āmy_custom_fieldā to the Invoice module, you would include it in the template like this:
My Custom Field: $invoice.my_custom_field
Make sure to save the changes to the template and then generate a new PDF to see the custom fields included in the output.
Hello mbaranzke, thanks for taking the time to reply.
I followed your instructions, however at #4, there is no āPDF Templatesā Repair list option in v7.11.18.
I continued from #5 there, and should mention the module is āInvoicesā not āInvoiceā.
My custom field is āpaid_date_cā, I adjusted the name to ā$invoices.paid_date_cā but it still printed that literal field name and not its value. Iāll try any other suggestions, thanks.
Anyone know how to add a custom field from the Invoices module to a PDF template in 7.11.18?
Thanks.
Step 1: Create a PDF Invoice in PDF Templates (or edit one you already have) Type = Invoices
Step 2: Edit the layout as you wish and add the field to the template. To insert a field just select your field from the dropdown and insert it anywhere you like.
Step 3: Print your invoice with the new PDF template.