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
naresh johnnaresh john 

Redirection to web tab

HI every one,

 

    When user clicks on new button in custom objects data, I need to redirect the user to a web tab(created from external website url). 

 

   Can any one please let me know how to achieve this requirement.

 

Thanks,

Naresh

Best Answer chosen by Admin (Salesforce Developers) 
Imran MohammedImran Mohammed

As much as i know it cannot be found.

You should use the lid value that will be shown in the URL when you access the Webtab.

Let me know if you have any questions

All Answers

Ispita_NavatarIspita_Navatar

On the custom button which you have added, you can execute a javascript snippet(choose this option as you create the new button) and then define the snippet as below in the text area provided for this purpose.

 

Code snuppet:-

 

window.parent.location.href 'http://yoururl.com'
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.
naresh johnnaresh john

Thanks for the reply. But my requirement is,

 

when I click on new button I am able to redirect to the we tab. But I given a static link.I need to make it dynamic.

 

My real problem is, web tab will have a id(lid), How to get this web tab id, in a apex class by its name.

 

Please help me.

 

Thanks,

Naresh

Ispita_NavatarIspita_Navatar

let me understand the issue you are facing ?

Correct me if my interpretation is wrong OK

 

Say I have a button for creating a new account record, so what you want is that after the creation the user should be redirected to the detail page of that account thus created?

Is it what you want to do?

 

naresh johnnaresh john

Thanks for the reply.

 

Let me explain the requirement.

 

 

I have custom object. It has a list of records. When users clicks on new button, I should redirect the user to a web tab.It will have a form. I can do this with custom button over ride by a visualforce page and apex class.

 

I did redirection with static Id of the web tab. But How can I get Id of the web tab dynamically by its name in the apex class.

 

Thanks,

Naresh

Imran MohammedImran Mohammed

To redirect to Web tabs, First access the Webtab you created. 

Then, you should copy the relative path from the Webtab URL i.e. from /servlet/servlet.Integration?lid=idval&ic=1 and create a pagereference with that.

That will navigate you to Webtab.

naresh johnnaresh john

I understood what you said.

 

But my problem is how to get lid(Id of the web tab) by its name. 

 

I am searching since a long time. But I did not find it.

 

Thanks,

Naresh

Imran MohammedImran Mohammed

As much as i know it cannot be found.

You should use the lid value that will be shown in the URL when you access the Webtab.

Let me know if you have any questions

This was selected as the best answer
naresh johnnaresh john

Thanks for the great help.