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
AlanisticAlanistic 

Custom VF page for a custom object

I've created a custom object that has 3 fields: ID, Name (string text) and Body (rich text).

 

I want to create a visualforce page that simply displays a list of the names, with each name acting as a link.

 

The link should open a page showing the Name and the Body.  The body is rich text and will include formatting and images.

 

Can anyone help with some directions?  I've tried with standard controllers, custom controllers, and I'm having no luck getting anything to work.  I'm really new to APEX and Visualforce.

Sonam_SFDCSonam_SFDC

Hi Alanistic,

 

You can do the following:

Create 2 VF pages :

1st to display the record list 

2nd to show the detail of the record clicked on the first page

 

Use a standard controller to fetch the records from the custom object you have created and use the apex:outputlink tag to create a hyperlink to the detail page of that record like:

 

<apex:outputLink value="/apex/customDetailPage?id={!customrecord.id}">
{!customrecord.Name}
</apex:outputLink>

 

Assuming that your 2nd VF page checks for the id parameter to establish which record it should be display.

 

Hope this helps!