Find your content:

Search form

You are here

Visualforce $Action Global Variable for 'Submit for Approval' doesnt work


I am trying to add 'Submit for Approval' button in my visualforce page as per salesforce documentation (using global actions) -

As per documentation Action for this is - 'Submit for Approval' (which is wrong how come there will be spaces in between).

I tried following - (I was sure this is not going to work )

<apex:commandButton action="{!URLFOR($Action.Opportunity.Submit for Approval, Id)}" id="Discount_Approval" value="DiscountApproval" />    

then tried with "SubmitforApproval" - no luck doesn't work

following edit link works fine -

<apex:commandButton action="{!URLFOR($Action.Opportunity.Edit, Id)}" id="Discount_Approval" value="Edit" /> 

Attribution to: Prafulla Patil

Possible Suggestion/Solution #1

I had this same requirement. You need to construct the button using "$Action.your_object.submit" like below:

<apex:commandButton value="Submit for Approval" action="{!URLFOR($Action.opportunity.submit, Id)}" id="Submit_for_Approval"/>

Attribution to: Jay Herrea

Possible Suggestion/Solution #2

The URL expression is


You can get all the actions when you try to create a custom button on Opportunity with Execute Javascript behaviour. Handy way to let salesforce construct it for you!

enter image description here

Attribution to: techtrekker
This content is remixed from stackoverflow or stackexchange. Please visit

My Block Status

My Block Content