2

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.

1
  • Did you consider custom labels ? Apr 9, 2014 at 7:31

1 Answer 1

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}");
3
  • only if the custom setting is a hierarchy type ;-)
    – brovasi
    Apr 9, 2014 at 8:06
  • And what if it is list?
    – AnuRaj
    Apr 9, 2014 at 8:17
  • I don't think you want to use a list setting for the simple text output? Apr 9, 2014 at 8:23

You must log in to answer this question.

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