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
RedSalesRedSales 

Approval Process: How to Edit Pop-Up Warning Message on Clicking to "Submit For Approval"

Hello,

 

I have a "Submit For Approval" button for my Opportunity Record. The button is a standard button (therefore not a custom button).

When i click on the button it pops-up a warning type message with the following text and an "ok" and cancel" button.

 

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

 

i wish to change the warning message that appears for users clicking on this button.  I've had a look at the Workflow & Approvals > Approval Processes settings but cannot find where this message is set in the first place.

 

Does anyone know where such settings are configured for Approval Process buttons?

 

Thanks in advance.

Best Answer chosen by Admin (Salesforce Developers) 
sebcossebcos

Hi,

that is the standard button's message and as far as I have seen cannot be customized.

To edit an approval process you can click on Edit button with an arrow. There you can configure the approval process but not that message.

If you need to change that message I am afraid the only way is via code:

You would have to create a custom button, which calls an Apex method exposed as a webservice which submits the approval.

You can find an example of a custom button which calls Apex here:

http://salesforcesource.blogspot.com/2009/06/triggering-apex-method-with-custom.html . You can then update the message displayed on submit by customizing the javascript. The above example sends an email, you need to change the Apex code to submit an approval but the concept is the same.

To submit the approval you can look at this example code :

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_process_example.htm .

Apex code needs to be covered by tests in order to be deployed to a production environment. 

You can find some example test code around approval process submission here: http://blog.jeffdouglas.com/2010/01/04/automating-salesforce-approval-processes-with-apex-triggers/  .

This should give you an idea of the effort and the development skills required to customize the message on approval submission. Hope this helps.

 

All Answers

RedSalesRedSales

Hi Again All,

 

I note there is no information either relating to a pop-up confirmation message for the  "Submit For Approval" in the following instructions on creating Custom Workflow & Approval Processes.

 

http://www.salesforce.com/us/developer/docs/fundamentals/Content/adg_workflow.htm


Do you think this is documented also somewhere?

 

Thanks.

sebcossebcos

Hi,

that is the standard button's message and as far as I have seen cannot be customized.

To edit an approval process you can click on Edit button with an arrow. There you can configure the approval process but not that message.

If you need to change that message I am afraid the only way is via code:

You would have to create a custom button, which calls an Apex method exposed as a webservice which submits the approval.

You can find an example of a custom button which calls Apex here:

http://salesforcesource.blogspot.com/2009/06/triggering-apex-method-with-custom.html . You can then update the message displayed on submit by customizing the javascript. The above example sends an email, you need to change the Apex code to submit an approval but the concept is the same.

To submit the approval you can look at this example code :

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_process_example.htm .

Apex code needs to be covered by tests in order to be deployed to a production environment. 

You can find some example test code around approval process submission here: http://blog.jeffdouglas.com/2010/01/04/automating-salesforce-approval-processes-with-apex-triggers/  .

This should give you an idea of the effort and the development skills required to customize the message on approval submission. Hope this helps.

 

This was selected as the best answer
jungleeejungleee

Hi

 

I know its been more than a year since you have asked this question. But I also faced the same challenge: changing the text of the pop-up message when clicked on the 'Submit for Approval' button. After little research I was able to change the text by adding a small jQuery script in the messages and alert component in the side bar. Below is the script hope it helps!

 

<script src="/resource/jQueryLibrary" type="text/javascript"></script>
<script type="text/javascript">
	var j$ = jQuery.noConflict();
	j$(document).ready(function
//fetch the url
		var currentLink = window.location.href;
//get the id of the record from yhe url.
		var theId = currentLink.substring((currentLink.length-15), currentLink.length);
//Check the object on which you want the to change the message text.
		if((theId.substring(0,3)) == "a0g"){
			var onclickValue = "if ((Modal.confirm && Modal.confirm(\' enter your text here.  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 && window.confirm(\' eneter your text here  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=%2F0"+theId+"&id="+theId+"\',\'DETAIL\',\'submit\');";
			j$("[value*=Submit]").attr('onclick', onclickValue);
		}
	});
</script>

 Thanks,

Sameer

 

Nataliia Zhaglova 2Nataliia Zhaglova 2
@jungleee,

Hi ,
I have the same question. Could you please describe step by step where exactly you put/set up this changes? 
​Thank you!