Scenario
There are cases when users encounter an unexpected error: The template cannot be printed due to the following errors: Error on line 7, column 14 in template. Detail… <macro> child is text node, which is disallowed: ignoring”
This line of code<macro> child is a text node, which is disallowed: ignoring” when printing the GL Impact using Advanced Templates. One of the possible reasons for this error is that a field being sourced contains special characters such as ampersands (&) that break the code. To resolve this, fix the advanced PDF template code to auto escape special characters.
Solution
- Navigate to Customization > Forms > Advanced PDF/HTML Templates
- Preferred Standard GL Impact PDF/HTML Template : Click Edit
- Top-right corner: Toggle Source Code
- Source code: Look for the code that sources data with special characters
- Sample
- Replace <td style=”width: 25%;”>${record.tranid}</td> with <td style=”width: 25%;”>${record.tranid?xml}</td>
- Note: The ?xml is added to auto-escape special characters such as ampersand (&). Replace tranid with the appropriate field id.
- Click Save