You need to sign in to do that
Don't have an account?
Challenge: Using Standard List Controllers - Error Message
Trying to complete this challenge. Recieve the following error message. Need help resolving:
"Challenge not yet complete... here's what's wrong:
The page does not bind to the record ID value (in order to link to the record detail page)"
Here's my code for 'AccountList.vfp':
<apex:page standardController="Account" recordSetVar="accounts">
<table border="1" >
<apex:repeat var="a" value="{!Account}">
<li>
<apex:outputLink value="/<record id>">
Record
</apex:outputLink>
</li>
</apex:repeat>
</table>
</apex:page>
"Challenge not yet complete... here's what's wrong:
The page does not bind to the record ID value (in order to link to the record detail page)"
Here's my code for 'AccountList.vfp':
<apex:page standardController="Account" recordSetVar="accounts">
<table border="1" >
<apex:repeat var="a" value="{!Account}">
<li>
<apex:outputLink value="/<record id>">
Record
</apex:outputLink>
</li>
</apex:repeat>
</table>
</apex:page>
Please try below code. I hope that will help you
Please let us know if that will help you
Thanks
AMit Chaudhary
All Answers
Challenge requires use of <li> tag and <apex:outputlink> component. Your example class does not use either. Your example does resolve binding error with record ID. Any thoughts?
Andy
Please try below code. I hope that will help you
Please let us know if that will help you
Thanks
AMit Chaudhary
You have used '/' in the line <apex:outputLink value="/{!a.id}" >. When I remove it, I am getting a Visualforce error.
Can you please let me know the reson? Thanks for help!!
-Shobit
Like below line
Please let me know if you need any more help
Can plz tell me how to complete this challenge using <apex:dataList>?
No error, nothing.
And this:
Anyone have an idea? I have tried deleting the page and redoing it from scratch.
I have done some variation using pageBlockTable similare to the contact list view example and still not thing.
<apex:page standardController="Account" recordSetVar="accounts">
<apex:pageBlock >
<apex:repeat var="a" value="{!accounts}" >
<li><apex:outputLink value="/{!a.id}">{!a.Name}</apex:outputLink></li>
</apex:repeat>
</apex:pageBlock>
</apex:page>
Dimitri - that code gives me the same output as I get from other examples in this page. Do you have data in your org?
The reason I ended up searching this was that I have the <li> as:
<apex:outputLink value="{! '/' + a.Id }">{!a.Name}</apex:outputLink>
It produced the correct output but failed the challenge
Would be interested to hear if anyone can explain the difference to :
<apex:outputLink value="/{!a.Id }">{!a.Name}</apex:outputLink>
"https://eu6.salesforce.com/{!a.id}"
my links worked from the page but the Challenge wanted the simpler version. Fair enough.
Thanks to all for this thread.
<apex:page standardController="Account" recordSetVar="accounts">
<apex:repeat var="a" value="{!accounts}">
<li><apex:outputLink value="/{!a.id}">{!a.Name}<record id="account"></record></apex:outputLink> </li>
</apex:repeat>
</apex:page>
Thanks
<apex:page standardController="Account" recordSetVar="accounts">
<apex:repeat var="a" value="{!Accounts}">
<li><apex:outputLink value="https://ue11.saleforce.com/{!a.id}"> {!a.name}
</apex:outputLink></li>
</apex:repeat>
</apex:page>
which also worked but failed the test. :-(
Please try below line Problem in your code is that you are adding baseURL "https://ue11.saleforce.com" which is good for your org only. Same code will not work in other server.
- Salesforce Answers
Second why trial head is unable to validate a possible correct answer with the absolute URL.
I am using the full URL as the value param:
<apex:page standardController="Account" recordSetVar="accounts">
<apex:repeat value="{!Account}" var="a" >
<li>
<apex:outputLink value="https://ap1.salesforce.com/{!a.Id}"> {!a.Name} </apex:outputLink>
</li>
</apex:repeat>
</apex:page>
My problem is, I stil cnnot tell the difference between mine and his.
Not starkdiffernces - It seems to have a mid f it's own.
The not binding might have smethig to do with login on SF expring maybe?
Any thoughts
I had the exclamation mark miissing for the value in the output liink.
I don't know if this is a bad hack, but it's the only way I could get non-operational but otherwise correct code to work.
Getting the same error [Challenge not yet complete... here's what's wrong:
The page does not bind to the record ID value (in order to link to the record detail page)] while using root URL as given,But working as expected. Is there anything wrong in conventions?
In order to complete the challenge, you would need to put URL like below(@Amit Chaudhary 8 has suggested in his answer.)
<apex:outputLink value="/{!a.id}" > {!a.name} </apex:outputLink>
For all who are wondering how to full URL should work, this is it:
<apex:outputLink value="https://brave-panda-g71exy-dev-ed.lightning.force.com/lightning/r/Account/{!a.id}/view" >
Seems the component has some magic that makes it know where to place the a.id.
<apex:repeat value="{!accounts}" var="a">
<li>
<apex:outputLink value="/{!a.id}"> {!a.name} </apex:outputLink>
</li>
</apex:repeat>
</apex:page>
Try this!
<apex:page standardController="Account" recordSetVar="accounts">
<apex:repeat var="a" value="{!accounts}">
<li>
<apex:outputLink value="/{!a.id}" >
{!a.name}
</apex:outputLink>
</li>
</apex:repeat>
</apex:page>
<apex:page standardController="Account" recordSetVar="Accounts">
<apex:pageBlock title="AccountList">
<apex:repeat value="{!Account}" var="a">
<li>
<apex:outputLink value="/{!a.id}" >
{!a.name}
</apex:outputLink>
</li>
</apex:repeat>
</apex:pageBlock>
</apex:page>