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
citeitciteit 

How can I open a custom tab via a custom link / button?

I a custom tab which loads a custom s-control which is no more than a link to a webapp I am writing.

How would I go about creating a custom link on an object page which opens this tab and passes to it the ID of the object that contained the custom link?

Thank you in advance!
HarmpieHarmpie
I think you need merge fields if I understand you correctly, e.g. http://mylink/mypage.php?id={!Account.Id}
 
citeitciteit
I am trying to create a custom link on the Opportunity object which will open a custom tab I have created in Salesforce. The tab itself has a URL like:
https://na5.salesforce.com/servlet/servlet.Integration?lid=01r7000000027ma&ic=1 but is there a way to programatically determine the servlet/servlet.Integration?lid=01r7000000027ma&ic=1 part?
shillyershillyer

I think you need to use a Global Variable. Take a look at

 

$ObjectType

 

Best,

Sati

citeitciteit
I do not understand how that will help me.

My custom tab loads a URL-based s-control, so I do not have an $ObjectType that I can access.


shillyershillyer
The custom tab you want opened, is that a custom object tab or web tab?
citeitciteit
Web tab... sorry thought I had implied that when I said tab loads a s-control.
shillyershillyer
If your tab calls a S-control, then why not have the custom link call the s-control directly? You can then use a merge field like {!$ObjectType.Opportunity} to determine the ID of the Opportunity and pass that to your web app.
 
The only way I'm aware of to get the Tab URL programmatically is via the API using the DescribeTab call.
 
Best,
Sati
citeitciteit
Thanks all for the feedback.

I am aware of the ability to load the s-control directly, but I am being asked to load the tab for aesthetic reasons.

I was able to accomplish my goal by creating a s-control which uses the Apex Javascript functions to use describeTab(). I find the correct tab, get the url, and open it using JS.

Not the prettiest implementation, but it works...