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

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

| improve this answer | |
  • 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 '17 at 15:11
  • I tried that as well and I still get the same error. – cmmoutes13 Jun 2 '17 at 15:15
  • Still same error. – cmmoutes13 Jun 2 '17 at 15:18
  • verify your relationship API in workbench, see my updated answer – Santanu Boral Jun 2 '17 at 15:24
  • Genius Santanu. I always forget to check that. The relationship was actually SBQQ__LineItems__r – cmmoutes13 Jun 2 '17 at 15:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.