I am displaying a link on my VF page as follows:
<apex:pageBlockTable value="{!rightObjectList}" var="rightObject">
<apex:column headerValue="{!selectedObjectType}">
<apex:outputLink value="{!URLFOR(rightObject['Id'])}">Link</apex:outputLink>
</apex:column>
...
</apex:pageBlockTable>
The link is displayed in the column of the table but when I click it, it opens a salesforce page and displays the error: Page [whatever the id is] does not exist. The url of the page is :
..visual.force.com/apex/ [the id seen in the error]
Now if I remove the 'apex/' from the URL and make the url :
..visual.force.com/[the id seen in the error]
it goes to the particulare page of the object.
My question is, how do I remove that apex/ in the VF page's outputLink, so when a user clicks it, he is redirect to the correct URL page.
Or is there any other way to display record page using the id?