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
mdinatalemdinatale 

Need help with passing parameter on page load

I've been trying this for hours now with no luck. I have a standard controller and a extension, I want to pass a var to the extension controller so when the page is loaded the proper data is viewed. So TestStatus needs a value to work properly how to i get it the value so when the page loads it knows that value.

 

<apex:page standardController="Account" extensions="rpI"  showHeader="false" sidebar="false">
 <apex:form >

 <apex:outputText value="{!TestStatus}" escape="false"> 
 
 </apex:outputText>
 
 </apex:form>
 
</apex:page>

 

kiranmutturukiranmutturu

u need to set a value in the controller....

 

public class rpI{

 

string teststatus = 'answer';

 

public void setteststatus(string value){

 

teststatus = value;

}

 

public string getteststatus(){

 

return teststatus;

}

 

 

}

Abhay AroraAbhay Arora

Hi ,

 

If you want to pass a parameter from URL like

https://ap1.salesforce.com/apex/mypage?name='MYNAMe'

 

You need to use below in your constructor

ApexPages.CurrentPage().getParameters().get('name');

 

 please mark it as solved if above works for you