You need to sign in to do that
Don't have an account?
nemo nemo
How to use URLFOR with record ID?
I am creating a Visualforce page which displays the list of all account names from the standard Accounts object. I need to be able to list them as URLs so that when clicked they open their respective accounts as a detail page. I am stuck at using the record id in the URLFOR function.
This is what I am trying -
<apex:page standardController="Account" recordSetVar="accounts">
<apex:pageBlock title="Account" >
<apex:repeat value="{! Accounts}" var="a">
<ul>
<!-- <li> <apex:outputField value="{! a.name}"/> </li>
<li> <apex:outputLink value="{! URLFOR($Action.Account.Edit, Account.Id)}"> {! a.name} </apex:outputLink> </li>
</ul>
</apex:repeat>
</apex:pageBlock>
</apex:page>
I am using $Action.Account.Edit I know that is wrong. I need to be just able to display the account. How do I use the Account Id or the record ID to link this? I spent a lot of time trying this out but not able to figure out. Please help!
This is what I am trying -
<apex:page standardController="Account" recordSetVar="accounts">
<apex:pageBlock title="Account" >
<apex:repeat value="{! Accounts}" var="a">
<ul>
<!-- <li> <apex:outputField value="{! a.name}"/> </li>
<li> <apex:outputLink value="{! URLFOR($Action.Account.Edit, Account.Id)}"> {! a.name} </apex:outputLink> </li>
</ul>
</apex:repeat>
</apex:pageBlock>
</apex:page>
I am using $Action.Account.Edit I know that is wrong. I need to be just able to display the account. How do I use the Account Id or the record ID to link this? I spent a lot of time trying this out but not able to figure out. Please help!
Please use the below code:
Please do let me know if it helps you.
Regards,
Mahesh
All Answers
Please use the below code:
Please do let me know if it helps you.
Regards,
Mahesh
Please use below code for view:
Regards,
Mahesh