You need to sign in to do that
Don't have an account?
jaw999
VF table for Custom object and related objects
Please, it's probably a minor error I am missing, but can someone tell me what I am missing?
I want to reproduce the basic functionality of this table, copied directly from the VF Dev guide:
<apex:page standardController="Account"> <apex:pageBlock title=" {!$User.FirstName}!"> {!account.name} account report. </apex:pageBlock> <apex:pageBlock title="Contacts"> <apex:pageBlockTable value="{!account.Contacts}" var="contact"> <apex:column value="{!contact.Name}"/> <apex:column value="{!contact.MailingCity}"/> <apex:column value="{!contact.Phone}"/> </apex:pageBlockTable> </apex:pageBlock> </apex:page>
But when I use my objects in this code:
<apex:page standardController="Customobject__c"> <apex:pageBlock title=" {!$User.FirstName}!"> {!Customobject__c.name} CDI Report. </apex:pageBlock> <apex:pageBlock title="Transcripts"> <apex:pageBlockTable value="{!Customobject__c.CustomRelatedObj__c}" var="CustomRelatedObj__c"> <apex:column value="{!CustomRelatedObj__c.Status__c}"/> <apex:column value="{!CustomRelatedObj__c.Knight_Products__c}"/> <apex:column value="{!CustomRelatedObj__c.Author__c}"/> </apex:pageBlockTable> </apex:pageBlock> </apex:page>
I get error:
Error: Invalid field Transcript__c for SObject Client_Development_Initiative__c
I don't understand. Why does one of these lines work and not the other?
<apex:pageBlockTable value="{!account.Contacts}" var="contact"> <apex:pageBlockTable value="{!Customobject__c.CustomRelatedObj__c}" var="CustomRelatedObj__c">
I found the error in my relationship syntax using the schema browswer in the Eclipse tool.
All Answers
Can you make sure the relationship name is correct ? Is it Customobject__c.CustomRelatedObj__c or Customobject__c.CustomRelatedObj__r. Also I would advise using variable name(var) as CustomRelatedObj rather than CustomRelatedObj__c
gets me the same error,
That it is saying "SObject" in the error message makes me pause.
If i take the standard out of the opening line:
I get the nonsensical error message
which is a bug b/c my page name is "CDIR"
Try this.
-Naidu
I found the error in my relationship syntax using the schema browswer in the Eclipse tool.
I am having the same issue with this. Can you elaborate on how you figured out the correct syntax?