I am trying to add 'Submit for Approval' button in my visualforce page as per salesforce documentation (using global actions) - http://login.salesforce.com/help/doc/en/dev_action_values.htm
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
{!$Action.Opportunity.Submit}
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!
Attribution to: techtrekker
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/4533