7

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" /> 

2 Answers 2

14

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!

enter image description here

2
  • What will happen if I am not authorized for submitting the record for approval?
    – doga
    Nov 19, 2012 at 6:18
  • No different from the standard button I should think, it mimicks the behaviour, doesn't override it. Nov 19, 2012 at 9:15
2

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"/>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .