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
Vikas_SVikas_S 

How to get URL Parameter in Visualforce Page

Hi,

 

I'm redirecting to new visualforce page in my class.

created URL look like.

https://xxx.visual.force.com/apex/NewPage?TestValue=value1&retURL=a0HS000000450UD

 

I'm trying to get TestValue into my Visualforce Page...

code of Page is here..

 

<apex:page standardController="XXX__c" extensions="EEE_Test">
    <apex:form >
        <apex:pageBlock >
        <apex:pageBlockSection columns="1">
             <apex:inputField value="{!CurrentPage.parameters.TestValue}"/>
    </apex:pageBlockSection>
        </apex:pageBlock>  
    </apex:form>
    </apex:page>

 

I'm getting "Save error: Field parameters does not exist. Check spelling."  during saving this page.

 

Please suggest how to get value from the URL in page InputField?

 

Best Answer chosen by Admin (Salesforce Developers) 
Pradeep_NavatarPradeep_Navatar

Replace your code with the syntax given below :

 

<apex:inputField value="{!$CurrentPage.parameters.Paramtervalue}"/>

 

Hope this helps.

All Answers

aballardaballard

I believe you can use $CurrentPage.parameters.parametername

 

 

Pradeep_NavatarPradeep_Navatar

Replace your code with the syntax given below :

 

<apex:inputField value="{!$CurrentPage.parameters.Paramtervalue}"/>

 

Hope this helps.

This was selected as the best answer
ssssssssssssss

Thanks Pradeep!!!!

SanjivaniSanjivani

Hi, I am using same syntax but still getting error, pl help

 

 <apex:inputField value="{!$CurrentPage.Parameters.id}"/>

Edweek ShaneEdweek Shane

Hi Sanjivani,

 

Use inputText instead of inputField and you'll be good to go.  

 

inputFields need to be bound to (i.e., to reference) sObject fields.  

inputText creates a standard HTML field; no special binding there.

 

Shane

khillan bhardwajkhillan bhardwaj

Hi you must use <apex:inputField value="{!$CurrentPage.parameters.TestValue}"/> instead of <apex:inputField value="{!CurrentPage.parameters.TestValue}"/> as parameter is global resource

JaguarJaguar
And why is this not working

https://c.xxx.visual.force.com/apex/CaseVehicles?CaseNum=252899


<apex:inputField value="{!Case_Vehicle__c.VIN__c}"/>
<apex:inputText value="{!$CurrentPage.parameters.CaseNum}"/>
<apex:inputField value="{!Case_Vehicle__c.Color__c}"/>

I tried <inputField value = > as well

Gives me the same error as above.


venkatasubbareddy adurivenkatasubbareddy aduri
I am getting Error like "Field Parameters does not exist. Check spelling." even if i am using 
<apex:inputText value="{!$CurrentPage.Parameters.billingStreet}"/>