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
Steve Ross 39Steve Ross 39 

passing paramters to visualforce page

Having an issue passing the record Id to a visualforce page with a controller exitension.

My URL is

public class entityViewControllerExtension {

    public Id recordId {get; set;}
    public Account acct {get;set;}
    // The extension constructor initializes the private member
    // variable acct by using the getRecord method from the standard
    // controller.
    public entityViewControllerExtension(ApexPages.StandardController stdController) {
        this.acct = (Account)stdController.getRecord();
        this.recordId = stdController.getId();
        system.debug('entityViewControllerExtension: acct.Id='+acct.Id);
        system.debug('entityViewControllerExtension: recordId='+recordId);      
VF page:
<apex:page standardController="Account" extensions="entityViewControllerExtension" tabStyle="account">
    <apex:form >
            <apex:pageBlockSection columns="2">
                <apex:pageBlockSectionItem helpText="...">
                    <apex:outputLabel value="Entity View"/>
                    <apex:outputText> fields will go here </apex:outputText>
                <apex:pageBlockSectionItem labelStyle="display:none;" dataStyle="display:none;">
                    <apex:outputText >&nbsp;</apex:outputText>
                    <apex:outputText >&nbsp;</apex:outputText>

I see null values from my debug statements and can't understand why. This must be an issue with the URL format as it works in classic but not lightning. 

Any help is much appreciated!
Raj VakatiRaj Vakati
Change it as below 

You forget to pass Id=<Record Id> 
Correct one is this

Shruti SShruti S
Could you please tell us how you are invoking this page ?
Steve Ross 39Steve Ross 39
By using the URL with the record Id parameter (see top of my post). The format of the Url seems to be the issue. Perhaps I'm not passing the Id parameter correctly. I have the new url format enabled.