+ Start a Discussion
VFVF 

navigation to standard pages using Page reference method

Hello,

 I am using the below code to redirect to the standard salesforce pages as:

 

    public PageReference Save()

    { 

String newPageUrl = 'https://ap1.salesforce.com/701/o';

   PageReference newPage = new PageReference(newPageUrl);

   newPage.setRedirect(true);

   return newPage; 

    } 

 This piece of code helps in navigating the page to campaign default page.Here the url-"https://ap1.salesforce.com/701/o" is the campaigns default page url for my account.

 

Instead of passing the complete url is there any way to redirect to sandard campaign page in pageReference method. 

 

Thanks,

shaan 

Best Answer chosen by Admin (Salesforce Developers) 
wesnoltewesnolte

Hey

 

You should be able to use the relative part of the URL. That way you could change servers without having any issues,

 

 PageReference newPage = new PageReference('/701/o');

 

I'm not sure if you ahve to include that first foward slash though.

 

Wes 

All Answers

wesnoltewesnolte

Hey

 

You should be able to use the relative part of the URL. That way you could change servers without having any issues,

 

 PageReference newPage = new PageReference('/701/o');

 

I'm not sure if you ahve to include that first foward slash though.

 

Wes 

This was selected as the best answer
VFVF

Thanks for ur reply wes , i am able to use the relative part url for navigation.

I have a doubt that will the relative part  url ('/701/o') will be the same for all SF accounts.

I mean the '/701/0' relative part will be  similar for other standard pages. 

thanks

shaan 

Message Edited by VF on 08-11-2009 06:32 AM
wesnoltewesnolte

Hey

 

It should work. Other standard page URLs can be found:

 

http://salesforce.phollaio.com/2007/01/11/salesforces_url_structure/

 

Cheers,

Wes