Scenario
If the error is encountered when previewing/saving an Advanced PDF/HTML Template, one of the possible causes is that the variable is referenced outside its scope. (e.g. the error is returned if the 'check' variable is referenced outside the code <#list records as check> and </#list>)
Solution
- Navigate to Customization > Forms > Advanced PDF/HTML Templates
- Affected Template: Click Customize
- Top right corner: Switch to Source Code
- Find and fix the erroring variable
- Click Save
Note: When the same error is thrown on printing a Transaction Record employing the particular advanced template in question, it means that there is a value referenced in the source code of the template, whose value is empty or missing on the custom record, in which case a value for the field should be provided on the affected record, or source code be altered with <#if> condition, allowing for field to be printed without error in spite of its missing or null value.