+ Start a Discussion
Suresh RaghuramSuresh Raghuram 

Issue in capturing parameters from the URL

Hi Community,

I am navigating from one vf page to another vfpage and passing parametrs through URL and trying to capture the parameters in the other controller.

My Url looks like this.
https://c.cs16.visual.force.com/apex/AgreementAdvanceFilterPage?AccountId=001f000000H0HGAAA3

I used the following methods
string str = ApexPages.currentPage().getUrl() ;
string accountId = ApexPages.currentPage().getParameters().get('AccountId');

Above both did not work for the above said scenario.

What is the issue and how can i over come it.
Please share your thoughts and ideas.

Thanks,
Suree 
Ramu_SFDCRamu_SFDC
See if this helps http://www.forcetree.com/2009/06/passing-parameters-to-visualforce-page.html
Vinit_KumarVinit_Kumar
This line is correct :-

string accountId = ApexPages.currentPage().getParameters().get('AccountId');

Can you debug to see what's coming in accountid.Also,if you can post the whole code it would be asy to debug ...
lakslaks
Hi Suree,

The code - string accountId = ApexPages.currentPage().getParameters().get('AccountId');  should work ideally.

Why are you using different controllers ? Associating the same controller with both the pages should work.

Regards,
Lakshmi.
Suresh RaghuramSuresh Raghuram
both pages have two different standard controller, So i prefered them to be in the different controllers.
Suresh RaghuramSuresh Raghuram
Thanks for the reply I got it just with what I was did.