+ Start a Discussion
WEN JIEWEN JIE 

Send mail from Custom Button or Link

Hi,

 

I need a custom button display on my standard page layout. When I click this button can send mail to some users.

So I create a custom button, and in the "Behavior" field, I choose "Execute JavaScript". Then I try to invoke my remote action to send maill.

 

if(confirm('Is your Distribution list updated ?')){
    alert('send');
    AuditController.saveAudit(auditData , SaveCallBack, {escape:true});
}
else{
    alert('just save');
}

function SaveCallBack(result, event){
    alert(1);
}

 

But it fail. When code go to the ture condition. There is a error tell me AuditController is not defined.

 

So does anyony know how to send mail by a custom button on the standard pagelayout?

 

Thank you!

imutsavimutsav
is your AdditController a static class and saveAudit is a static function ?
WEN JIEWEN JIE

The AdditController just a public class and the saveAudit is a static methond in my apex.

 

public class AuditController{

    @RemoteAction
    public static String saveAudit(ObjectMapping auditData){}
}