Skip to content

Instantly share code, notes, and snippets.

@Sunil02kumar
Created January 25, 2015 17:43
Show Gist options
  • Save Sunil02kumar/d9747dfb66e1c4a76246 to your computer and use it in GitHub Desktop.
Save Sunil02kumar/d9747dfb66e1c4a76246 to your computer and use it in GitHub Desktop.
{!REQUIRESCRIPT("/soap/ajax/30.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/30.0/apex.js")}
try{
var eventId= '{!Event.Id}';
var nurl="/"+eventId;
// Now make a synchronous call to the Apex Web service method
var result = sforce.apex.execute (
"SendNotificationToAttendee", // class
"sendNotification", // method
{ eid: eventId }
);
alert("Notification sent succusfully");
window.location.replace(nurl);
}catch(e){
alert('some system error occured. Please try later');
}
//*************Apex Class******************
global class SendNotificationToAttendee{
WebService static boolean sendNotification(Id eid){
//write your logic here
return true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment