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
mangiamangia 

How to redirect to custom tab? How to get custom tab's URL ?

I am building an AppExchange app.  I have an S-Control assigned to a link on the Contact page.  When the link is clicked, user should be redirected my custom tab -- currently this works fine:  (see below).
 
top.window.location='https://na4.salesforce.com/servlet/servlet.Integration?lid=01r60000000197t&ic=1&myID=21';
 
Problem; current URL is hardcoded to my custom tab (i.e. https://na4.salesforce.com/servlet/servlet.Integration?lid=01r60000000197t&ic=1).  How to I reference and build the URL in javascript so the link will reference properly for anyone who downloads & uses my app?
 
I have tried using variations of {!UrlFor($Action.my Custom Tab.New,null,null)} ... but I must be missing something as it do not syntax check correctly.
 
Chris
 
 
 
 
michaelforcemichaelforce

The packaging process is pretty darn clever, I have found.  Often times I referenced documents in s-controls via hard coded Id and the package was smart enough to resolve it to point to the correct Id upon installation.

First make the link relative:  top.window.location='/servlet/servlet.Integration?lid=01r60000000197t&ic=1&myID=21';

And then try packaging everything, uploading it, and reinstalling it in another org... it might work properly.

Karthi_VeluKarthi_Velu

Really is it will work like what you described above as while doing package it will take care of everything. Let me know the ans from both you friends.

 

Because i am searching for 2 weeks to regaring redirecting to web tab from apex controller but no luck. i got some s control code.

 

in my apex controller code i am redirecting to web tab like.

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