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
Karthi_VeluKarthi_Velu 

Get the Web Tab url in apex controller without hardcode?

Folks,

 

From my apex class i want to get the 'Web Tab' URL using its name.  I want to avoid the hardcoding the url my code following.

 

 

private final String RedirectUrl = '/servlet/servlet.Integration?lid=01r70000000EWxQ&ic=1'; public PageReference cancelView(){ PageReference newPage = new PageReference(RedirectUrl); newPage.setRedirect(true); return newPage; }

 

 

 

jeffdonthemicjeffdonthemic

Can you simply use the frontdoor urls for each object? Would that work?

 

Jeff Douglas

Informa Plc

http://blog.jeffdouglas.com

Karthi_VeluKarthi_Velu

Thanks for your responce.
 

I couldn't understand, You mean hardcode the web tab url right. But when i will take the package that time It won't work in new installed login right(due to id may change in RedirectUrl = '/servlet/servlet.Integration?lid=01r70000000EWxQ&ic=1').

 

This is my problem. So that only iam searching for generic solution to redircect the another web tab url from apex.

 

jeffdonthemicjeffdonthemic

Sorry... I thought you were talking about a custom object tab. I'm not sure that you have any alternative but to hardcode the address. It shouldn't be an issue as the id of the tab remains the same when you refresh sandboxes from production. Or are you talking about some sort of managed package?

 

Thanks

 

Jeff Douglas

Informa Plc

http://blog.jeffdouglas.com