You need to sign in to do that
Don't have an account?

Datatable to show child object data
I am trying to create a VisualForce page that will display Quote and Quote Line Item (both custom objects from the AppExhange application) data. Below is my code but it is erroring out with:
Error: Invalid field SFDC_520_QuoteLine__r for SObject SFDC_520_Quote__c |
Code:
Error: Invalid field SFDC_520_QuoteLine__r for SObject SFDC_520_Quote__c <apex:page renderAs="pdf" standardcontroller="SFDC_520_Quote__c"> <p style="text-align:center; font-size: 100%;">ONESOURCE ORDER SCHEDULE</p> <p style="text-align: right; font-size: 80%"> Contract No: <apex:outputtext value=" {!SFDC_520_Quote__c.Contract_Number__c}" /></p> <p style="text-align: left; line-height: .05; font-size: 70%"> <b>Customer Name:</b> <apex:outputtext value=" {!SFDC_520_Quote__c.Opportunity_Account_Name__c}" /></p> <p style="text-align: left; line-height: .05; font-size: 70%"> <b>Customer No:</b> <apex:outputtext value=" {!SFDC_520_Quote__c.Opportunity_Account_PMD_Id__c}" /></p> <p style="text-align: left; line-height: .50; font-size: 70%"> <b>Customer Subscribes to the following OneSource On-line Service(s):</b></p> <apex:dataTable value="{!SFDC_520_Quote__c.SFDC_520_QuoteLine__r}" var="Product"> <apex:facet name="caption">table caption</apex:facet> <apex:facet name="header">table header</apex:facet> <apex:facet name="footer">table footer</apex:facet> <apex:column footerValue="column footer" value="{!Product.Product_Code__c}"/> </apex:dataTable> </apex:page>
What am I missing?
<SCRIPT type=text/javascript>//
var tabId = getCookie('dmTab');
var closeButtonId = 'thePage:theForm:closeButton';
if (tabId && getBottomPanelHeight() > 28) {
showCloseButton(closeButtonId, true);
} else {
showCloseButton(closeButtonId, false);
}
document.getElementById('thePage:theForm:showControllerLink').style.display = (false) ? 'inline' : 'none';
//
</SCRIPT>
There have been issues in the past with relationships not having a given child relationship name. To be sure you need to either:
1: Check the enterprise WSDL
2: Use a schema browser like the one in the Force.com IDE, SoqlXplorer or similar
3: Go to the field definition in setup
Easiest is probably 3 in this case.
In the section of the field definition detail page labeled "Master-Detail Options" you should see a field label of "Child Relationship". If you see no value there then that is your problem. Click edit, give it whatever name you want then add that to your page with "__r" appended to it.
I just verified that any relationship type works (lookup or M/D).
All Answers
Message Edited by TehNrd on 06-19-2008 01:39 PM
The child object SFDC_520_QuoteLine__c has a master-detail relationship with the parent SFDC_520_Quote__c. Quote is a custom field on the SFDC_520_QuoteLine__c object and it is of type Master-Detail. What type of relationship is necessary for this to be recognized as a related list object?
There have been issues in the past with relationships not having a given child relationship name. To be sure you need to either:
1: Check the enterprise WSDL
2: Use a schema browser like the one in the Force.com IDE, SoqlXplorer or similar
3: Go to the field definition in setup
Easiest is probably 3 in this case.
In the section of the field definition detail page labeled "Master-Detail Options" you should see a field label of "Child Relationship". If you see no value there then that is your problem. Click edit, give it whatever name you want then add that to your page with "__r" appended to it.
I just verified that any relationship type works (lookup or M/D).