I have created a custom object and on the object i have created a custom button. when click on the button it send an email. And a pop up comes with a message "you have send an email". Now i have create a custom setting. I need to customize the popup message. I want to display the message from the custom setting. I am using Behavior of the button as Execute JavaScript. my code :
OnClick JavaScript:
{!REQUIRESCRIPT("/soap/ajax/15.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/15.0/apex.js")}
var r = confirm("This position details would be shared with CM-Focus Staffing services.");
if(r == true)
{
sforce.apex.execute("ctrl_sendEmail_ToCM","sendEmail",{jId:"{!Position__c.Id}"});
alert("CM-Focus Staffing Services have been notified. CM-Focus would be in touch with the hiring manager shortly");
}`
How can i achieve it. Please guide me to get the solution.
Attribution to: AnuRaj
Possible Suggestion/Solution #1
Say we have a custom setting object named "MySettings__c" and a setting in it named "Setting1", so we can access it directly from the custom button code:
alert("{!$Setup.MySettings__c.Setting1__c}");
Attribution to: Sergej Utko
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/32278