1


I wanna add a custom button (Send Mail) on contact detail page, And is email field is having an email then on click he ask with a popup "Wanna send a mail ?" And wanna add 'Yes' Or 'No' instead off 'Ok' and 'Cancel' .

enter image description here

2 Answers 2

4

There is no exact and simple solution for this OK and CANCEL in Confirm Popup using javascript. But you can do this with the help of JQUERY. Try the below link to understand better...

https://stackoverflow.com/questions/823790/javascript-confirm-popup-yes-no-button-instead-of-ok-and-cancel

Update:

Open jQuery Dialog from Custom Button

https://success.salesforce.com/answers?id=90630000000h9p6AAA

Hope this helps...

3
  • ,OK! But can we use jQuery onclick of button that is add to detail page of any contact's record.,????
    – AkshAy
    Commented May 12, 2016 at 6:59
  • I think you can...Just see my updated Links for that....
    – Subhash
    Commented May 12, 2016 at 7:07
  • Thnks a lot Subhash :)
    – AkshAy
    Commented May 12, 2016 at 7:16
0

onclick="return confirm('Wanna send a mail?');"

If you return a false onclick the method will not be called. The confirm function returns true or false (OK or Cancel).

/////////----------------------------------------///////

Display Type : Detail Page Button

Behavior : Execute Javascript

Content Source : Onclick Javascript

and in the text box copy the below JS code ,

{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")} 
    {!REQUIRESCRIPT("/soap/ajax/20.0/apex.js")} 
    var x;
    if (confirm("Wanna send a mail!") == true) {
        x = "YES";
    } else {
        x = "NO";
    }
    if(x == 'NO'){ 
      window.location.replace('/{!Account.Id}')
    } 

else { 
window.location.replace('/apex/AccountDetail?id={!Account.Id}') //replace your VF page here
}
1
  • It'll show OK and Cancel But i want instead of them Yes and No
    – AkshAy
    Commented May 12, 2016 at 7:00

You must log in to answer this question.

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