1

So I am working on a Visualforce Email Template and I am stuck. I am trying to pull a field from a related object to the one that the template would be generated from. When I put in the Child Relationship Name into the code it says that it is not a valid field. I know this is the proper name and I know I have done this before. Not sure what I am missing here.

Error: Invalid field LineItems for SObject SBQQ__Quote__c

Code

Here is the Relationship field screenshot: Relationship Field Screenshot

1 Answer 1

1

You should use correct relationship API instead of LineItems if I can consider relatedToType is Custom Quote object and LineItem is also custom object.

I am guessing it could be LineItems__r

<apex:repeat var="li" value="{!relatedTo.LineItems__r}">

</apex:repeat>

Update

It will be better to use correct relationship API verifying from Workbench. Here is a sample picture.

relationship

5
  • It is actually a custom Quote object SBQQ_Quote__c and a custom Quote Line object SBQQ__QuoteLine__c. I will add a picture of the relationship field to my original post.
    – cmmoutes13
    Jun 2, 2017 at 15:11
  • I tried that as well and I still get the same error.
    – cmmoutes13
    Jun 2, 2017 at 15:15
  • Still same error.
    – cmmoutes13
    Jun 2, 2017 at 15:18
  • verify your relationship API in workbench, see my updated answer Jun 2, 2017 at 15:24
  • Genius Santanu. I always forget to check that. The relationship was actually SBQQ__LineItems__r
    – cmmoutes13
    Jun 2, 2017 at 15:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .