S-Docs Display record for unrelated objects
You can display a record for objects that do not have a direct relation with each other. For example, you want to display Quote Charge Tier records with a Quote Charge summary in a PDF, as shown in the following table.

The two fields are not directly related. A parent-child structure needs to be created to display this information in the PDF.
To create the relationship table, perform the following steps:
- Create a child component with the Template Format as Component. See Create Templates in S-Docs.
The template name mentioned in this template creation process would be used in the parent template. - Click the Template Editor button and paste the following code for the child component:
<!--RENDER='{{!prefix2.rownum}}'== '0' --> <table border="0" cellpadding="0" cellspacing="0" style="width: 100%;"><!-- ENDRENDER--> <tbody> <tr> <td style="font-size: 14px;text-align: center;padding: 2px 2px;white-space: normal;word-wrap:break-word;font-weight: normal;">{{!prefix2.zqu__ProductRatePlanCharge__r.Name}}</td> <td style="font-size: 14px;text-align: center;white-space: normal;word-wrap:break-word;font-weight: normal;"> <table border="1" cellpadding="0" cellspacing="0" style="width: 100%;border-collapse: collapse;"> <tbody><!--{{!<lineitemsSOQL> <class>table439</class> <soql>select id,zqu__StartingUnit__c,zqu__EndingUnit__c,zqu__Price__c from zqu__QuoteCharge_Tier__c where zqu__QuoteRatePlanCharge__c = '{{!prefix2.zqu__QuoteRatePlanCharge__c}}'</soql> <column header="From" format- number="#,###.##" nullprefix="N/A">zqu__StartingUnit__c</column> <column header="To" format- number="#,###.##" nullprefix="N/A">zqu__EndingUnit__c</column> <column header="Price" format- number="#,###.##" nullprefix="N/A">zqu__Price__c</column> </lineitemsSOQL>}}--> </tbody> </table> </td> <td style="font-size: 14px;text-align: center;padding: 2px 2px;white-space: normal;word-wrap:break-word;font-weight: normal;">{{!prefix2.zqu__Quantity__c}}</td> <td style="font-size: 14px;text-align: center;padding: 2px 2px;white-space: normal;word-wrap:break-word;font-weight: normal;">{{!prefix2.zqu__EffectivePrice__c}}</td> <td style="font-size: 14px;text-align: center;padding: 2px 2px;white-space: normal;word-wrap:break-word;font-weight: normal;">{{!prefix2.zqu__TotalPrice__c}}</td> <td style="font-size: 14px;text-align: center;padding: 2px 2px;white-space: normal;word-wrap:break-word;font-weight: normal;">{{!prefix2.zqu__Period__c}}</td> </tr> </tbody> <!--RENDER='{{!prefix2.rownum}}'== '0' --> </table> <!--ENDRENDER--> - Create a parent component.
- Click the Template Editor button and paste the following code for the parent component:
<style type="text/css">table.table439 {border-collapse: collapse; font-size: 14px; font-family:Arial Unicode MS,sans-serif; width:100% ;border: 1px solid #C1CED9; } .table439header {font-size: 14px;text-align: center;padding: 5px 5px;white-space: normal;word-wrap:break-word;font-weight: normal;background: #F5F5F5; } </style> <table border="1" cellpadding="0" cellspacing="0" class="table439"> <tbody> <tr> <td class="table439header">Rate Plan Name</td> <td class="table439header">Tier Details</td> <td class="table439header">Quantity</td> <td class="table439header">Effective Price</td> <td class="table439header">Total Price</td> <td class="table439header">Period</td> </tr> </tbody> <!--{{! <LineItemsSOQL> <class></class> <ListName>zqu__QuoteChargeSummary__c</ListName> <soql>select id,zqu__QuoteRatePlanCharge__c,zqu__ProductRatePlanCharge__r.Name,zqci 15__Quantity__c, zqu__EffectivePrice__c,zqu__TotalPrice__c, zqu__Period__c from zqu__QuoteChargeSummary__c where zqu__QuoteRatePlan__r.zqu__Quote__c = '{{!ObjectID15}}' and zqu__ChangeLog__c != null</soql> <column componentMergeField="true">rownum</column> <column componentMergeField="true">zqu__QuoteRatePlanCharge__c</column> <column componentMergeField="true">zqu__ProductRatePlanCharge__r.Name</column> <column componentMergeField="true">zqu__Quantity__c</column> <column componentMergeField="true" format- number="#,###.##">zqu__EffectivePrice__c</column> <column componentMergeField="true" format- number="#,###.##">zqu__TotalPrice__c</column> <column componentMergeField="true">zqu__Period__c</column> <component columnFields="true" mergeFieldPrefix="prefix2">Child Charge Summary</component> </LineItemsSOQL> }}--> </table>
