• Amit Pal 3
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

Hi All,

 

We have a requirement to display user confirmation pop up  on-click of std ‘Save’ button on opportunity page layout.

We have achieved it through JS on home page component. It works neatly for the normal edit page but does not work well on the inline edit page.

The problem is that although the pop up message gets displayed, the "SAVE' thereafter does not happen. Appreciate any help on this.

Below is the code snippet for inline edit page:

 

function overrideTheSavebtn(){

var URL = document.location.href;

if(URL.indexOf('006') > 0){

var probab = document.getElementById('opp12');

if( probab.value!='90')

{

document.getElementsByName('inlineEditSave')[0].onclick = function(){

var choice = confirm('All orders will be deleted if you change the probability to less than 90. Do you want to continue?'); return choice;};}

}}

/* add a method onload */

var oldonload = window.onload;

if (typeof window.onload != 'function') {

window.onload = oldonload; }

else { window.onload = function() {

if (oldonload) { oldonload();}

overrideTheSavebtn();}}

</script>

 

 

Regards,

Sapna