function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
BenPBenP 

repeat table not showing data

I'm creating a VF template to show some data and then the related data in a table.  I've been able to complete all but the related data, it's not showing.  The object is SVMXI__Parts_Request__c and the child object is SVMXI__Parts_Request_Line__c.  My current page (rough draft) is as follows:

<messaging:emailTemplate subject="Order confirmation" recipientType="User" relatedToType="SVMXI__Parts_Request__c">
<messaging:htmlEmailBody >
<br />
<br />
A parts order going to {!relatedto.Name__c} was just completed for you.  <br />
<br />
Ship to: {!relatedto.Name__c} <br />
Due Date: {!relatedto.Due_Date__c} <br />
<br />
<br />
<table border="0">
               
                    <tr >
                        <th>QTY</th>
                        <th>PART #</th>
                        <th>DESCRIPTION</th>
                    </tr>
                    
                    <apex:repeat value="{!relatedto.Parts_Request_Line__r}" var="prlin">
                    <tr>
                        
                        <td> {!prlin.Qty__c}</td>
                        <td> {!prlin.Parts__r.Name}</td>
                        <td> {!prlin.Parts__r.ProductCode}</td>
                    </tr>
                     </apex:repeat>
                     
           </table>


</messaging:htmlEmailBody>
</messaging:emailTemplate>

 The problem is that I'm not getting any data from parts request lines in the table.  I should mention these are part of a managed package.  Also when I go to the child object and check the lookup to the parent object, the child relationship name is R00N70000001ryqzEAA vs. a real name like other components.  

ClintLeeClintLee

Have you tried adding the namespace prefix to the repeat value like {!relatedTo.SVMXI__Parts_Request_Line__r}?

 

~ Clint

BenPBenP

I have, but I then get an error.

 

Error: Invalid field SVMXI__Parts_Request_Line__r for SObject SVMXI__Parts_Request__c

 


BenPBenP

I believe I found the solution.   It seems the managed package was not setup correctly because the child relationship name is R00N70000001ryqzEAA vs. Parts_Request_Line as it should be.  Using this unique Id instead of the name seems to be working.

 

{!relatedto.SVMXI__R00N70000001ryqzEAA__r}

 

This isn't a solution really, but it works.