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
vodnuravodnura 

Submit for Approval Button..

I am trying to add submit for approval button on my visualforce page. Can any one suggest how  i can achieve it.

 

thanks-

AJ

Best Answer chosen by Admin (Salesforce Developers) 
SamReadySamReady

You can create the button with HTML. I was able to view the source of the Submit for Approval button by inspecting the element:

 

<input value="Submit for Approval" class="btn" title="Submit for Approval" name="submit" onclick="if ((Modal.confirm &amp;&amp; Modal.confirm('Once you submit this record for approval, you might not be able to edit it or recall it from the approval process depending on your settings. Continue?')) || (!Modal.confirm &amp;&amp; window.confirm('Once you submit this record for approval, you might not be able to edit it or recall it from the approval process depending on your settings. Continue?'))) navigateToUrl('/p/process/Submit?retURL=%2F[[[[[[INSERT YOUR RECORD ID HERE]]]]]&amp;id=[[[[[[INSERT YOUR RECORD ID HERE]]]]]','DETAIL','submit');" type="button">

All Answers

SamReadySamReady

You can create the button with HTML. I was able to view the source of the Submit for Approval button by inspecting the element:

 

<input value="Submit for Approval" class="btn" title="Submit for Approval" name="submit" onclick="if ((Modal.confirm &amp;&amp; Modal.confirm('Once you submit this record for approval, you might not be able to edit it or recall it from the approval process depending on your settings. Continue?')) || (!Modal.confirm &amp;&amp; window.confirm('Once you submit this record for approval, you might not be able to edit it or recall it from the approval process depending on your settings. Continue?'))) navigateToUrl('/p/process/Submit?retURL=%2F[[[[[[INSERT YOUR RECORD ID HERE]]]]]&amp;id=[[[[[[INSERT YOUR RECORD ID HERE]]]]]','DETAIL','submit');" type="button">

This was selected as the best answer
vodnuravodnura

Thanks a lot..

SamReadySamReady
You're welcome :)
vodnuravodnura

I was succesfull in creating the Custom Approval Button. But i couldnt add it to visualforce page using Command action. Is ther another way to do it..

 

Thanks in advance..

SamReadySamReady

Apologies I have been out of office and am just seeing this now. Did you get the button issue resolved? If not please post your code and describe the issue in more detail. Thanks!