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
SwapnilSwapnil 

StartUrl issues

I have tried the following for the startUrl in Site.login method. But the returnURL still returns only the 1st parameter. It should return both the parameters in the url.

 

--------------------------------------------------------

 

startUrl = '/home?a=' + value1 + '~b=' + value2;
PageReference page = Site.login(username, password, startUrl);

String temp = page.getParameters().get('retURL');
temp = temp.replaceAll('~', '&');
page.getParameters().put('retURL', temp);

return page;
--------------------------------------------------

OR

Used '+' instead of '&' in the startURL.

-----------------------------------------------------

 

Any suggestions that I can try to make it work....

 

imuino2imuino2

Hi, why don't you try this?

 

startUrl = '/home';
PageReference page = Site.login(username, password, startUrl);

page.getParameters().put(a, value1);

page.getParameters().put(b, value2);

 

This way you will put the parameters in the url, you cant just write the parameters.

 

Ignacio.