You need to sign in to do that
Don't have an account?
SARANG DESHPANDE
Create a Visualforce page which shows a list of Accounts linked to their record pages
I was solving this challenge and my VF code is:
<apex:page standardController="Account" recordSetVar="Accounts" >
<apex:pageblock>
<apex:repeat var="a" value="{!Accounts}" rendered="true" id="account_list">
<li>
<apex:outputLink value="https://ap1.salesforce.com/{!a.ID}" >
<apex:outputText value="{!a.Name}"/>
</apex:outputLink>
</li>
</apex:repeat>
</apex:pageblock>
</apex:page>
I am getting the list of accounts as required and on clicking on any of the accouts, it redirects to that accounts detail page.
Still I am getting following error from trailhead:
"The page does not bind to the record ID value (in order to link to the record detail page)"
<apex:page standardController="Account" recordSetVar="Accounts" >
<apex:pageblock>
<apex:repeat var="a" value="{!Accounts}" rendered="true" id="account_list">
<li>
<apex:outputLink value="https://ap1.salesforce.com/{!a.ID}" >
<apex:outputText value="{!a.Name}"/>
</apex:outputLink>
</li>
</apex:repeat>
</apex:pageblock>
</apex:page>
I am getting the list of accounts as required and on clicking on any of the accouts, it redirects to that accounts detail page.
Still I am getting following error from trailhead:
"The page does not bind to the record ID value (in order to link to the record detail page)"
Please let us know if this will help u
All Answers
Please let us know if this will help u
The above code is not working for me. I am getting a blank screen.
Can you please check you have any account record in your org ?
The above code is not working for me. First when I do Preview, no Account record appears, secondly when I try to Verify the Challenge, its gives the error "The page does not bind to the record ID value (in order to link to the record detail page)". I don't understand what is the issue here..
Could anybody please help me.
Thanks
Deepak
I'm still not clear why our solutions, which appears to provide working results that meet the instructions, is unacceptable.
How are you testing this? When you click on preview, is it displaying the list of accounts ?When I use the same code and click preview, I could see only a blank page. Please clarify. Thanks
I don't know what is the difference between two below statements.
<li> <apex:outputLink value="/{!a.Id}" id="theLink">{!a.Name}</apex:outputLink> <br></br> </li>
or
<li> <apex:outputLink value="https://c.na35.visual.force.com/{!a.Id}" id="theLink">{!a.Name}</apex:outputLink> <br></br> </li>
both are fine, but to pass the challenge we have to use the first one, that's strange.
The page 'AccountList' was not found.
Below is code which seems correct but im getting the above error. Do i need to change any permission settings?
<apex:page standardController="Account" recordSetVar="Accounts" >
<apex:pageblock >
<apex:repeat var="a" value="{!Accounts}" rendered="true" id="account_list">
<li>
<apex:outputLink value="/{!a.ID}" >
<apex:outputText value="{!a.Name}"/>
</apex:outputLink>
</li>
</apex:repeat>
</apex:pageblock>
</apex:page>
Setup--> Visualforce pages.
<apex:page standardController="Account" recordSetVar="accounts">
<apex:pageBlock>
<apex:repeat value="{!accounts}" var="a">
<li>
<apex:outputLink value="/{!a.ID}">
<apex:outputText value="{!a.name}"/>
</apex:outputLink>
</li>
</apex:repeat>
</apex:pageBlock>
</apex:page>
This worked for me
A little research shows that if you go straight to buiding a page as above, then preview that page, it commonly shows only a blank page. Then you go to the normal standard page for that object (Account) - this brings up the Recent list view. Just go back to the page you built and refresh - Voila! The results from the Recent list view now appear. Go back to the Account page, and select the All Accounts list view, then go back to your VF page. Again - you see a different result - now you get all accounts.
So does someone know why this happens? It appears to be a function of the standard list controllers. Is it reusing a cache when displaying list values in the above code?
<apex:page standardController="Account" recordSetVar="acc">
<apex:repeat value="{!acc}" var="a" rendered="true">
<apex:outputField value="{!a.name}"/><br/>
</apex:repeat>
</apex:page>
This was working all right few hours back but now it is showing a blank page,i did'nt made any changes to the code or to my org.Also the same code is working on a different machine perfectly fine.
PS: If i pass record id in the address bar then it works perfectly fine
In one of the previous units you learned how to copy the ID from the URL of an actual account in your Dev instance. Please do the same for this and it works. Please check Jim's answer for details.
@Jim Stevens and Amit Chaudhary and others who've offered valuable help. Saved a lot of headache and time.
https://XXXve-moose-194704-dev-ed--c.na59.visual.force.com/apex/AccountSummary?core.apexpages.request.devconsole=1&id=001j000000DqtjbAB
does absolutely nothing. Just shows the previously loaded preview page. Even I removed a digit in the account id to ssee if it fails at least this time, but same difference.
In my code, I have:
<apex:page standardController="Account">
Name: {! Account.Name } <br/>
Phone: {! Account.Phone } <br/>
Industry: {! Account.Industry } <br/>
Revenue: {! Account.AnnualRevenue } <br/>
</apex:page>In the preview, what I see is just:
Name:
Phone:
Industry:
Revenue:
I checked in the main Account details page I have all that info filled (Account: Dickenson plc)
I am using the following code, and the challenge displays "Challenge not yet complete... here's what's wrong:
The page component does not include the Account standard controller."
<apex:page standardController="Account" recordSetVar="accounts" >
<br/><br/>
<apex:pageBlock title="Account Records">
<apex:form >
<apex:pageBlockTable value="{!accounts}" var="acc">
<apex:column value="{!acc.Name}"/>
<apex:column value="{!acc.AccountNumber}" />
<apex:column value="{!acc.Phone}"/>
<apex:column value="{!acc.Industry}"/>
<apex:column value="{!acc.Type}" />
</apex:pageBlockTable>
</apex:form>
</apex:pageBlock>
</apex:page>
You have to create link for all accounts with its name.
use following code and try once.
<apex:page standardController="Account" recordSetVar="Accounts" >
<apex:pageblock>
<apex:repeat id="accountListId" var="acc" value="{!Accounts}" rendered="true" >
<li>
<apex:outputLink value="/{!acc.ID}" >
<apex:outputText value="{!acc.Name}"/>
</apex:outputLink>
</li>
</apex:repeat>
</apex:pageblock>
</apex:page>
My code is working fine as explained by our Experts. When we preview our page it is showing a blank page, Right! But have you noticed when we go to our org's Accounts page and come back to visual force page it is showing the list? Have a try. I don't know the reason behind this, anyone's explanation is appreciated.
<apex:page standardController="Account" recordSetVar="Accounts" >
<apex:slds/>
<apex:form>
<apex:pageblock title="Accounts List">
<apex:repeat var="a" value="{!Accounts}" rendered="true" id="account_list">
<li>
<apex:outputLink value="/{!a.ID}" >
<apex:outputText value="{!a.Name}"/> <br/>
<apex:outputText value="{!a.AccountNumber}"/>
</apex:outputLink>
</li>
</apex:repeat>
</apex:pageblock>
</apex:form>
</apex:page>
How do I unsubscribe from this thread ? Thanks
The page does not bind to the record ID value (in order to link to the record detail page)
Also I was not getting the detail page upon clicking the Account Name on the bulleted list. I changed the following in my code.
<apex:outputLink value="https://URcompanyordeveloperOrg.lightning.force.com/lightning/r/Account/{!a.ID}/view" >. See the word 'view' added at the end.
To ensure that the code works, I added the filter and I was able to complete the challenge
Here is my codes:
<apex:page standardController="Account" recordSetVar="Accounts" >
<apex:form>
<apex:pageblock>
<apex:repeat var="a" value="{!Accounts}" rendered="true" id="accountListId">
Filter:
<apex:selectList value="{! filterId }" size="1">
<apex:selectOptions value="{! listViewOptions }"/>
<apex:actionSupport event="onchange" reRender="accountListId"/>
</apex:selectList>
<li>
<apex:outputLink value="/{!a.ID}" >
<apex:outputText value="{!a.Name}"/>
</apex:outputLink>
</li>
</apex:repeat>
</apex:pageblock>
</apex:form>
</apex:page>
Hi All ,
I also had the same issue but it gets resolved after when I Clicked on Standard Account list view and changed its Filter to All Accounts it worked!!! I refreshed my page and its showing all accounts now.
Here is my code :
<apex:page standardController="Account" recordSetVar="accounts" >
<apex:pageblock >
<apex:repeat var="a" value="{!Accounts}" rendered="true" id="account_list">
<li>
<apex:outputLink value="/{!a.ID}" >
<apex:outputText value="{!a.Name}"/>
</apex:outputLink>
</li>
</apex:repeat>
</apex:pageblock>
</apex:page>
Please use it as your reference if you also find the same issue in your org.
Thanks
We have to add id property and bind id in value as mentioned below,
<apex:page standardController="Account" recordSetVar="accounts">
<apex:pageBlock title="Account List">
<!--Accounts List-->
<apex:repeat value="{! accounts}" var="a" rendered="true" id="account_list">
<!--
<apex:pageBlockSection title="{! a.Name }">
<apex:pageBlockTable value="{! a.contacts }" var="con">
<apex:column value="{! con.Title }"/>
<apex:column value="{! con.FirstName }"/>
<apex:column value="{! con.LastName }"/>
<apex:column value="{! con.Email }"/>
</apex:pageBlockTable>
</apex:pageBlockSection>
-->
<li>
<apex:outputLink value="/{! a.ID}" id="recordID">
<apex:outputText value="{! a.Name }" />
</apex:outputLink>
</li>
</apex:repeat>
</apex:pageBlock>
</apex:page>
<apex:outputLink value="/{!a.id}" > //Get your ID by going to App Manager->Account->Select any record ->Select the id from URL(i.e. 0012v00002J7ROvAAN)-->then paste your ID on challenge precedded by &id= which wil look like (&id=0012v00002J7ROvAAN)
This will give the records
TIA
I went to the account of the app store then copy the link of an account paste it in the code and replaced it with the {! a.id}.
Copy this hyperlink. Code is working fine, but not getting the points.
<apex:page label="AccountList" standardController="Account" recordSetVar="accounts">
<apex:pageBlock>
<apex:repeat value="{! accounts }" var="a">
<ul>
<li><apex:outputLink value="https://cunning-impala-fxlyrb-dev-ed.lightning.force.com/lightning/r/{! a.id}/view">
<apex:outputText value="{!a.name}"/>
</apex:outputLink>
</li>
</ul>
</apex:repeat>
</apex:pageBlock>
</apex:page>