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' .
2 Answers
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...
Update:
Open jQuery Dialog from Custom Button
https://success.salesforce.com/answers?id=90630000000h9p6AAA
Hope this helps...
-
,OK! But can we use jQuery onclick of button that is add to detail page of any contact's record.,????– AkshAyCommented May 12, 2016 at 6:59
-
-
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
}
-
It'll show OK and Cancel But i want instead of them Yes and No– AkshAyCommented May 12, 2016 at 7:00