Reading this thread it seem like it is possible to get the grandchild (not sure if this correct term) of an entity: https://forum.espocrm.com/forum/deve...nd-grand-child
But that is for Query not for PDF Template Printing.
Anyway here is an example data:
PDF Template on Contact
(For entity Contact)
Contact Name: Mr John Smith
Contact Account: EspoCRM
Account Title: Director
(For entity Account)
Account name: EspoCRM
Relationship: Mr John Smith - Director
Relationship: Mr Stuart Smith - Engineer
Relationship: Ms Jane Smith - Finance
And here is what I'm trying to do.
When I print John Smith PDF, I also want to know what other contact is in the Account EspoCRM. I tried variation code like so but it doesn't seem to work, only added 3 method below otherwise I tried about 10 variation.
This would get me the Contact information
Now to try and get "grandchild"
Test 1
Test 2
Test 3
Why not just go into Account and use this code?
Because I want to get Contact information as well. And there is more information I want from Account not just the name and Role.
If anything not clear please let me know. Appreciate if anyone know on a how-to solve this.
But that is for Query not for PDF Template Printing.
Anyway here is an example data:
PDF Template on Contact
(For entity Contact)
Contact Name: Mr John Smith
Contact Account: EspoCRM
Account Title: Director
(For entity Account)
Account name: EspoCRM
Relationship: Mr John Smith - Director
Relationship: Mr Stuart Smith - Engineer
Relationship: Ms Jane Smith - Finance
And here is what I'm trying to do.
When I print John Smith PDF, I also want to know what other contact is in the Account EspoCRM. I tried variation code like so but it doesn't seem to work, only added 3 method below otherwise I tried about 10 variation.
This would get me the Contact information
Code:
{{#each accounts}} {{name}} - {{contactRole}} {{/each}}
Test 1
Code:
{{#each contacts.accounts}} {{name}} - {{contactRole}} {{/each}}
Code:
{{#each accounts.contact}} {{name}} - {{contactRole}} {{/each}}
Code:
{{#each accounts}} {{name}} - {{contactRole}} {{#each contacts.accounts}} {{name}} - {{contactRole}} {{/each}} {{/each}}
Code:
{{#each contacts}} {{name}} - {{contactRole}} {{/each}}
If anything not clear please let me know. Appreciate if anyone know on a how-to solve this.
Comment