PDF Template Issue

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • 4n6chick
    Junior Member
    • May 2023
    • 5

    PDF Template Issue

    I'm trying to print a list of attachments in my PDF template. The template is for the entity "Evidence Item" which has "Evidence" as its parent. Both entities have multiple attachments for photographs and log files.

    I can print the attachments for the Evidence Item attachment-multiple fields using the code below.

    <tr>
    <td colspan="4" align="center"><span style="font-size: 12px;">
    {{#if photographs}}
    {{#each photographs}}{{this.name}}<br>{{/each}}
    {{else}}<center><i>None.</i></center>{{/if}}
    </span></td>

    <td colspan="4" align="center"><span style="font-size: 12px;">
    {{#if logFiles}}
    {{#each logFiles}}{{this.name}}<br>{{/each}}
    {{else}}<center><i>None.</i></center>{{/if}}
    </span></td>
    </tr>​

    However, when I want to print the entries in the same fields stored in the parent "Evidence" entity using the code below, I get "None" even when there are files located in those records.

    <tr>
    <td colspan="4" align="center"><span style="font-size: 12px;">
    {{#if evidence.attachments}}
    {{#each evidence.attachments}}{{this.name}}<br>{{/each}}
    {{else}}<center><i>None.</i></center>{{/if}}
    </span></td>

    <td colspan="4" align="center"><span style="font-size: 12px;">
    {{#if evidence.miscellaneousFiles}}
    {{#each evidence.miscellaneousFiles}}{{this.name}}<br>{{/each}}
    {{else}}<center><i>None.</i></center>{{/if}}
    </span></td>
    </tr>​

    I am using the Dompdf engine.

    Thanks in advance!
  • yuri
    Member
    • Mar 2014
    • 8440

    #2
    Unfortunately, related records of a related record are not loaded.
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    Working...