Resolve Error: ” child is text node, which is disallowed” When Printing GL Impact Using Advanced PDF Templates

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
  1. Navigate to Customization Forms Advanced PDF/HTML Templates
  2. Preferred Standard GL Impact PDF/HTML Template : Click Edit
  3. Top-right cornerToggle Source Code
  4. Source code: Look for the code that sources data with special characters
  5. 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.
  1. Click Save

Leave a comment

Your email address will not be published. Required fields are marked *