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
imishraimishra 

Hide standard 'Submit For Approval' button

Hi,
I have a custom button through which i am submitting a record for approval.
So i want to remove the standard 'Submit For Approval' and 'Recall Approval Request' button from the approval history related List.
I tried to create a Home Page Component to hide it, but it doesn't work.
Please let me know whether i am missing out something.

Below is my code:

<script>
$j = jQuery.noConflict();
$j("input[name='piSubmit']").hide();
</script>

Thanks.
bob_buzzardbob_buzzard
Do you get any javascript errors?  
imishraimishra
No i am not getting any error.
I can see this label in the home page and also the button is not hidden. 
gb.apexgb.apex
Hi
you can remove standard buttons from pagelayout through only. goto pagelayout edt-->select buttons--> remove
imishraimishra
But i think there is no option to remove the 'Submit For Approval' button from the page layout.
tvmtvm
Try this:
<script>
   $j = jQuery.noConflict();
   $j(document).ready(function(){   
   $j("input[name='piSubmit']").hide();
   });
  </script>
Hd037Hd037

tvm Its Really works for me..

 

Thanks a lot for it..

DancyDancy
Hi
Can you share me how did you implement it exactly?
Below is what I have tried unsuccessfully:
1. Create a new Visual Force page with apex script same as what tvm suggested.
2. Create a Home Page Component of above VF Page.
3. Add Component to the Home Page Layout (tried both Narrow and Wide sections there)
4. Navigated to the target custom object tab but still the Submit for Approval button is visible. Note that this is a standard button and not a custom button.

Thanks a lot in advance,
Bruno CaetanoBruno Caetano

Hi,

I have the same problem of sindhu mani.

I have done everything as him and still have the button being displayed in the Approval History Related List.

tvm / Hd037 can you please explain how you have implemented this solution?

Thanks in advance.

shashi lad 4shashi lad 4
Hi All,
I had to gone thru this before. what i finally did is develop a custom visualforce page and called related list in visualforce page wrapped with facet. It will hide the buttons and as you mentioned you are using custom button.. here is the code ..hope it will help. Only issue i had was i can't put that page in related list so i had to compromise to include the page in detail area.

Please vote if it helped you which give me encouragement to help others.


<apex:page standardController="Opportunity" extensions="Controller_Approval_History_Override">
<apex:messages />
   <apex:relatedList list="ProcessSteps" title="Booking Guidelines Approval History" subject="{!Opportunity.id}" >
    <apex:facet name="header">
           <apex:form >
       
          <div align="center">
                 <apex:commandButton id="submitBtn" value="Submit Booking Guidelines" action="{!submitApp}" rendered="{!isStatusNotPending}" />
                 <apex:commandButton id="recallBtn" value="Recall Approval Request" action="{!doRecall}" rendered="{!isStatusPending}"   />
           </div>
        </apex:form>
    </apex:facet>
  </apex:relatedList>
</apex:page>