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
newbiewvfdevnewbiewvfdev 

<apex:detail /> tag not working as specified in the developers guide

Hi there,

 

I am trying to follow the example in the developers guide on page 21.

 

<apex:page standardController="Account">
    <apex:pageblock title="Hello {!$User.FirstName}">
        You are viewing the {!account.name} account.
    </apex:pageblock>
    <apex:detail />
</apex:page>

 

I dont' see the detail section. I only see the pageBlock section. What am I missing?

Best Answer chosen by Admin (Salesforce Developers) 
stephanstephan
I think the problem is that the param in your URL is Id (capital I) as opposed to id (lower case i).

All Answers

jwetzlerjwetzler

Did you supply an id to it?  If there's no record to display it won't show anything.

 

You can either visit your page with ?id=001xxx (replace 001xxx with the id of an account record) or you can specify a subject attribute on apex:detail with the id of the account you want to display.

newbiewvfdevnewbiewvfdev

Yes, I know about that. I am passing in the id. If I specify the subject attribute it works. But I am wondering why it's not working if I dont' specify it. On the documentation it says it should show it.

 

 

jwetzlerjwetzler
can you paste the full URL you're using to access your page?
jwetzlerjwetzler

First I've heard of this not working and I can't reproduce it myself.  I feel like I must be missing something.  You're using the exact code you pasted originally right?  With standardController="account"?

 

If you're using that exact code and URL then please log a case.

stephanstephan
I think the problem is that the param in your URL is Id (capital I) as opposed to id (lower case i).
This was selected as the best answer
jwetzlerjwetzler
nice catch, Stephan.  Yes, query parameters are case sensitive.
newbiewvfdevnewbiewvfdev

Thanks stephan and Jill,

 

That was a good catch indeed. But it's strange that it was able to access the account name using Id(Capital) but not the rest of the data.  By the way, is there a way to show just one of the relatedList through the detail tag?
I know there is a component called relatedList. But for some reason when I try using that for Campaign it doesn't work. Thanks.

 

This does not work:

<apex:page standardcontroller="Campaign"> <apex:relatedList list="CampaignMembers"/> </apex:page>