Created
January 25, 2015 17:43
-
-
Save Sunil02kumar/d9747dfb66e1c4a76246 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{!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