URL No Longer Exists. You have attempted to reach a URL that no longer exists on salesforce.com error.

In order to overcome 'URL No Longer Exists. You have attempted to reach a URL that no longer exists on salesforce.com' error, avoid using '/' at the end of the URL.

Correct Code:

pageReference pg = new pageReference('/apex/ExportAsCSV');
pg.setRedirect(true);
return pg;


Incorrect Code:

pageReference pg = new pageReference('/apex/ExportAsCSV/');
pg.setRedirect(true);
return pg;

'/' should not come at the end.


Cheers!!!

No comments:

Post a Comment