FIXED - PDF Custom Fields - Undefined Index Error

Hi guys,

Finally got round to editing our PDF invoice template and I am having some issues. I understand basic PHP but can not see what is wrong here - I have followed all the documentation at:
https://wiki.invoiceplane.com/en/1.5/templates/customize-templates

PDF Invoice Template Code

<td><?php echo 'Event Date' . ':'; ?></td>
                    <td><?php echo $custom_fields['Event Date']; ?></td>

But when generating the PDF I get a ‘Undefined Index’ error, the custom field “Event Date” definitely exists as i can prove this by printing the custom fields array to the screen, please see the attached screen shots.

Any ideas why it is unable to pull through this custom field? :thinking:

You are missing the invoice group.

<?php echo $custom_fields['invoice']['Event Date']; ?>

Perfect!

Makes sense…sorry it has been a long day at work! :see_no_evil:

Thank you.