3

I am trying to hide approve/reject links using visualforce area but it is not happening below is the code and i have already included this page in home page component-

<apex:page standardController="Directory__c">

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js">
</script>
<script>
    $(document).ready(function() {
        alert("I am an alert box!");
        $(".SidebarShortcut").hide();
    });
</script>

<script type="text/javascript" src="/resource/jQuery">
</script>

<script>
    $(document).ready(
        alert("I am an alert box!");

        function() {
            if ($("a:contains('Approve')").length > 0 || $("a:contains('Reassign')").length > 0) {
                $("a").filter(function() {
                    return $(this).text() == "Approve / Reject";
                }).hide();
                $("a").filter(function() {
                    return $(this).text() == "Reassign";
                }).hide();
            }
        });
</script>
</apex:page>
  • hmm looks like trying to access standard page links ? if Yes I suggest use <apex:relatedList list="ProcessSteps" ></apex:relatedList> for accessing the link. else you can access because of cross origin policy – Ratan Paul Jan 18 '16 at 7:43
  • yaa...how can i use related list in visulaforce? – akshay Jan 18 '16 at 7:50
  • this is the code <apex:relatedList list="ProcessSteps" ></apex:relatedList> add this code in your VF page – Ratan Paul Jan 18 '16 at 7:50
  • <apex:page standardController="Directory__c"> <apex:relatedList list="ProcessSteps" > <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"> </script> <script> $(document).ready(function(){ alert("I am an alert box!"); $(".SidebarShortcut").hide(); }); its not working? – akshay Jan 18 '16 at 8:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.