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
mikumiku 

How to override the 'submit for approval' button?

In my opportunity object.When the stage is changed.I need different approval process.I want to add different button for different approval process.I think I can write the Apex for calling the approval process.But how to use the default approval dialog?

 

Thanks 

IspitaIspita

Hi Miku,

One can only override the "Button" which are listed under the Standard button section of an object in the "Setup" area.

 

The buttons available for overriding are:-

  • Accounts Tab 
  • List 
  • View 
  • Edit 
  • New 
  • Delete

So I think the button in question is not exposed to overriding .

hope this helps....

Ankit AroraAnkit Arora

Yes, you can't override the submit for approval button, so in this case you need to create your own custom button and hide the native button from page layout.

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

IspitaIspita

Ankit's  suggestion is good way of achieving what you desire...

salesforcesss_deveoper211salesforcesss_deveoper211

Hi,

 

Can I get code snipit VF & Controller for this Submit for approval cutsom button on VF page.

 

Thanks.

Sanchivan SivadasanSanchivan Sivadasan

Hi Ankit,

 

I am trying to do something similar to this. But what I realize is that you cannot remove the Submit For Approval button from the Approval History Related list.  Please help. Thank you.

 

FG.

mikumiku

My solution is to set several approval process that have different ceterias for that object. you just need to click the same button.

I will go into the according process by the  Criteria.

I think to can't add buttons ont the related list.


Force.com Guru wrote:

Hi Ankit,

 

I am trying to do something similar to this. But what I realize is that you cannot remove the Submit For Approval button from the Approval History Related list.  Please help. Thank you.

 

FG.



Matheus MartinsMatheus Martins
Hello, you can create a section to this, called Approval History, and create a visual force like this one:
<apex:page standardController="YourObject__c">
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js" type="text/javascript"></script>
<script>
      $j = jQuery.noConflict();
    $j(document).ready(function() {    
      $j("input[name='piSubmit']").hide();
      $j(".pbHeader").hide();
      $j(".pShowMore").hide();
    });
</script>