You need to sign in to do that
Don't have an account?
West415
Append URL Parameters to PageReference?
Hi,
I have this code snippet and I'm trying to simply append some query string parameter to the end of it. How can this be done?
public with sharing class MyCustomController {
public PageReference login() {
return SiteVariables.getLogin();
}
}
I want to append a query string parameter to the end of the PageReference so when the "Login" page is returned it has a URL something like "http://site.com/apex/login?customerlocation=TX for example
In this example, "custoemrlocation" would be the variable with "TX" as the value.
Any help appreciated.
public PageReference login() {
Pagereference pageRef = SiteVariables.getLogin();
pageref.getParameters().put('custoemrlocation','TX');
return pageRef;
}
All Answers
public PageReference login() {
PageRegerence pgRef = SiteVariables.getLogin();
pgReg.getParameters.put('custoemrlocation', 'TX');
return pgRef;
}
public PageReference login() {
Pagereference pageRef = SiteVariables.getLogin();
pageref.getParameters().put('custoemrlocation','TX');
return pageRef;
}
Thanks again!