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
NaveenReddyNaveenReddy 

How to execute an action when selecting the standard tab ex. Opportunity,Account,Reports etc..

Hi,

 Can anybody please help me in how to execute custom action when we select a standard tab without changing its functionality..

Thanks in advance

Regards,
Naveen.
RishavRishav
Hii Naveen,
                  yes we can perform  some custom operation on click of standarde tab. For doing this you just need to do little tweaking.
                  1. Every tab is having one unique id like for case (Case_Tab) , so just copy the id and use the jquery to perform the client side operation like i have done.I am giving a  simple example it will work in you org also
<apex:page controller="trialAndError2">
<apex:includeScript value="{!$Resource.jquery}"/>
<script>
  $(document).ready(function(){
  $('#Case_Tab').click(function(){
    alert('hello');
  });
  });
</script>

</apex:page>

Here i am just showing one message after clicking on cases tab, you can perform other operation also.
If any  doubt please ask otherwise mark it as a kudos.

Thanks
Rishav
NaveenReddyNaveenReddy
Hi Rishav,

  Many thanks for the reply.

I tried below steps

1.Downloaded Jquery Library from http://jquery.com/download/
2.Created a static resource named "jquery" in my org.
3.Copied above code and ran, but no pop up is coming.Replaced #Case_Tab with some 15Digit Id and tried .Not working.

User-added image

Thanks,
Naveen
RishavRishav
can you send me your code?
 
NaveenReddyNaveenReddy
I used same code that you have given..

<apex:page controller="trialAndError2">
<apex:includeScript value="{!$Resource.jquery}"/>
<script>
  $(document).ready(function(){
  $('#Case_Tab').click(function(){
    alert('hello');
  });
  });
</script>
</apex:page>

and
  $('#500').click(function(){

and

 $('#5009000000WLP6r').click(function(){