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
CTU007CTU007 

Error: 'Quotes' is not a valid child relationship name for entity Opportunity

Hi, I am trying to add quote to my tabbed opportunity VF page, but got the error.

 

 

<apex:tab label="Quotes" name="Quotes" id="tabquote" rendered="{!$Profile.name='System Administrator'}" > <apex:relatedList subject="{!opportunity}" list="Quotes" /> </apex:tab>

 

But in the field definition, it shows Quotes.

 

 

Field Label Opportunity Name Field Name Opportunity Data Type Master-Detail(Opportunity) Child Relationship Name: Quotes

 

 I tried to look for it in Apex explorer, but could not find it.

 

Anyone can help?

 

 

 

Best Answer chosen by Admin (Salesforce Developers) 
Will MoxleyWill Moxley

The API Version needs to be 18 or at least 17 (ideally version 18.0). 

 

Edit your VF page, then click on the "Version Settings"sub tab.  The default tab will be "Visualforce Markup" where you edit your code, but click on the other tab.  There you can change the API version.  Set it to 18 and then it will recognize the Quotes object.  You'll need to do the same with any APEX code that references Quotes.

 

 

 

 

All Answers

CTU007CTU007

Tried

quotes__r; quote__r

with same error.

Will MoxleyWill Moxley

I assume you've enabled quotes. 

 

This is most likely an API version issue.  Are you using eclipse or the app to write your VF page?

CTU007CTU007

Yes, quotes are already enabled.

 

 

I am updating VF page in dev mode in browser.

Will MoxleyWill Moxley

The API Version needs to be 18 or at least 17 (ideally version 18.0). 

 

Edit your VF page, then click on the "Version Settings"sub tab.  The default tab will be "Visualforce Markup" where you edit your code, but click on the other tab.  There you can change the API version.  Set it to 18 and then it will recognize the Quotes object.  You'll need to do the same with any APEX code that references Quotes.

 

 

 

 

This was selected as the best answer
CTU007CTU007

Thanks, that works.

 

My VF page API version was 16.

 

Another question, some of the tabs now missing after the API change, for example:

 

 

<apex:tab label="Stage History" name="Stage History" id="tabstagehistory" rendered="{!$Profile.Id='00e00000006ophl'||$Profile.Id='00e00000006oo19'}" >
<apex:relatedList subject="{!opportunity}" list="OpportunityHistories" />
</apex:tab>

 

 The stage history is not visible to me now. I did not change anything here.

 

Message Edited by CTU007 on 03-08-2010 02:00 PM
CTU007CTU007

Following tabs (related lists) went missing after API version change:

 

Notes and Attachments

Approval History

Stage History

and a custom object  "Competitive Analysis"

 

No error occurred.

 

 

<apex:tab label="Notes and Attachments" name="NotesAndAttachments" id="tabNoteAtt" rendered="{!$Profile.Id='00e00000006ophl'||$Profile.Id='00e00000006oo19'}" > <apex:relatedList subject="{!opportunity}" list="NotesandAttachments" /> </apex:tab> <apex:tab label="Approval History" name="Approval History" id="tabapprovalhis" rendered="{!$Profile.Id='00e00000006ophl'||$Profile.Id='00e00000006oo19'}" > <apex:relatedList subject="{!opportunity}" list="ProcessSteps" /> </apex:tab> <apex:tab label="Stage History" name="Stage History" id="tabstagehistory" rendered="{!$Profile.Id='00e00000006ophl'||$Profile.Id='00e00000006oo19'}" > <apex:relatedList subject="{!opportunity}" list="OpportunityHistories" /> </apex:tab> <apex:tab label="Competitive Analysis" name="Competitive analysis" id="taboppcompana" rendered="{!$Profile.Id='00e00000006oijt'||$Profile.Id='00e00000006qngS'}" > <apex:relatedList subject="{!opportunity}" list="oppcompanalysis__r" /> </apex:tab>

 

 Any clue?

 

Will MoxleyWill Moxley
I can't see why that would happen. I  do see you have a rendered tag that says only to render if the profile id matches one of those profiles.  Are you sure your profile is matching them?  What happens if you remove that tab?  Does it change anything?
Will MoxleyWill Moxley
I meant to say "Remove that tag" not "tab".  try removing the render condition and see if that is the issue.
CTU007CTU007

It is strange, I did not change any markup for the 4 tabs, but I deleted the tag in sandbox for one tab, and it comes back.

 

My profile ID is within the rendered range. 

 

Not sure why this is happending.