Hyperlink field to open Visualforce page from related list in Salesforce?

Sample Code:

Visualforce page:

<apex:page controller="Sample" tabStyle="Account">
<apex:form >
<apex:pageMessages />
    <apex:pageBlock id="pg">
        <apex:pageBlockSection columns="1">
            <apex:outputField value="{!con.FirstName}"/>
            <apex:outputField value="{!con.LastName}"/>


Apex Class:

public class Sample {
    public Contact con {get;set;}
    Id conId {get;set;}
    public Sample() {
        conId = ApexPages.currentPage().getParameters().get('conId');
        con = [SELECT FirstName, LastName FROM Contact WHERE Id =: conId];





No comments:

Post a Comment

Sharing is Caring!!! Share this with your friends!!!

submit to reddit