Monday, August 11, 2014

11) How can one read parameter values through the URL in Apex.

Hi,

If you have ID parameter in the  URL then try this apex code.

public Id oppid{get;set;}
Id id = apexpages.currentpage().getparameters().get('id');
 
If you want to read parameter in Visualforce the write in 
visualforce page :
<apex:inputField value="{!$CurrentPage.parameters.Paramtervalue}"/>

If you have to add a parameter to the URL the use
ApexPages.currentPage().getParameters().put(parameterName , value);

No comments: