You need to sign in to do that
Don't have an account?
How can get URL param values at Apex Controller during POST method?
Hi,
==============================================================
This is HTML code of a form page. At submit button I need to save record at an Object.
Form action containes OurOwnVF page ,thus calls own Apex Controller.
Something same like WebToLead thing we are trying.
Now if form action method =GET, then easily I can get param name and param value from URL after clicked submit .
After click it goes to SaveObjectInformation page with parameters and at Apex class of that page get URL param value by System.currentPagereference .
================
String uniqueParamValue = System.currentPageReference().getParameters().get('UniqueNo');
=======================
URL param names are input fields name and value are respective to them.
So then insert at object.
But problem is that for method=POST System.currentPageReference().getParameters().get('UniqueNo'); returns NULL
How can get URL param values at Apex Controller during POST method?
Please help .I am stuck in this problem.
Thanks in advance
Hi
write in apex calss
public String Name{set;get;}
Hi
I didn't get your answer.. I think you didn't understand the issue in my above code
1- When I am using method=GET , i.e <form action="/SaveObjectInformation" method="GET">
<input type=hidden name="UniqueNo" id="UniqueNo" value="1"/>
<input type="submit" name="submit">
</form>
in apex controller System.currentPageReference().getParameters().get('UniqueNo'); returns correct value.
2- But IfI am using method=POST i.e <form action="/SaveObjectInformation" method="POST">
<input type=hidden name="UniqueNo" id="UniqueNo" value="1"/>
<input type="submit" name="submit">
</form>
in apex controller System.currentPageReference().getParameters().get('UniqueNo'); returns NULL.
So i' like to know about the process, to get input field value during POST method