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
Justin Epistola 1Justin Epistola 1 

Error: Unknown property ' - Trying to create an export button for related list

Hi all, I am new to Visualforce and is trying to create an export button for a custom object related list; I am getting an error when trying to save;  

Error: Unknown property 'OnePlace__Function__cStandardController.OnePlace__Function'

<apex:page standardController ="OnePlace__Function__c" contentType="application/vnd.ms-excel">
    <apex:pageBlock title="Invitees">
        <apex:pageBlockTable value="{!OnePlace__Function.OnePlace__Invitee__r}" var="item"> 
            <apex:column value="{!item.Name}"/> 
            <apex:column value="{!item.Initial_Contact__c}"/>
            <apex:column value="{!item.Investor_Contact__c"/>
            <apex:column value="{!item.NDA_Sent__c}"/>
        </apex:pageBlockTable>
    </apex:pageBlock>                          
</apex:page>

Thank you for your helping a noob!
Best Answer chosen by Justin Epistola 1
Nayana KNayana K
<apex:page standardController="OnePlace__Function__c" contentType="application/vnd.ms-excel">
    <apex:pageBlock title="Invitees">
        <apex:pageBlockTable value="{!OnePlace__Function__c.OnePlace__Attendees__r}" var="item">
            <apex:column value="{!item.Name}"/> 
            <apex:column value="{!item.Initial_Contact__c}"/>
            <apex:column value="{!item.Investor_Contact__c"/>
            <apex:column value="{!item.NDA_Sent__c}"/>
        </apex:pageBlockTable>
    </apex:pageBlock>                          
</apex:page>

 

All Answers

Nayana KNayana K
<apex:pageBlockTable value="{!OnePlace__Function__c.OnePlace__Invitee__r}" var="item">

You are just missing __c
Justin Epistola 1Justin Epistola 1
I tried it; 

New error pops; 
Error: Invalid field OnePlace__Invitee__r for SObject OnePlace__Function__c

Thank you!
 
Nayana KNayana K
 OnePlace__Invitee__r  is not the right relationship name. 
Setup > Search objects -> Locate Invitee object -> 
Click on the field that is the lookup to the Function > Look at the Child Relationship name

 
Justin Epistola 1Justin Epistola 1
Child Relationship Name    Attendees
I tried changing it; 

<apex:page standardController="OnePlace__Function__c" contentType="application/vnd.ms-excel">
    <apex:pageBlock title="Invitees">
        <apex:pageBlockTable value="{!OnePlace__Function.OnePlace__Attendees__r}" var="item">
            <apex:column value="{!item.Name}"/> 
            <apex:column value="{!item.Initial_Contact__c}"/>
            <apex:column value="{!item.Investor_Contact__c"/>
            <apex:column value="{!item.NDA_Sent__c}"/>
        </apex:pageBlockTable>
    </apex:pageBlock>                          
</apex:page>

Error: Unknown property 'OnePlace__Function__cStandardController.OnePlace__Function'

Thank you! 
Nayana KNayana K
<apex:page standardController="OnePlace__Function__c" contentType="application/vnd.ms-excel">
    <apex:pageBlock title="Invitees">
        <apex:pageBlockTable value="{!OnePlace__Function__c.OnePlace__Attendees__r}" var="item">
            <apex:column value="{!item.Name}"/> 
            <apex:column value="{!item.Initial_Contact__c}"/>
            <apex:column value="{!item.Investor_Contact__c"/>
            <apex:column value="{!item.NDA_Sent__c}"/>
        </apex:pageBlockTable>
    </apex:pageBlock>                          
</apex:page>

 
This was selected as the best answer
Justin Epistola 1Justin Epistola 1
Thank you for your patience in helping me!! I really appreciate it! It works like magic!!
Nayana KNayana K
Most Welcome :)