You need to sign in to do that
Don't have an account?
Kyle Buzza
Creating Event on Visualforce Button Click
I'm trying to both open a link and create a new event on the click of a custom button on the contact object. I'm able to open the link, but when I uncomment the line,
Here is my full code:
sforce.connection.create([e]);it breaks the code and neither inserts the new event nor opens the link. I'm not sure what I'm missing. Any help would be appreciated.
Here is my full code:
<apex:page id="pg" standardController="Contact"> <script> function openPage (){ var e = new sforce.SObject("Event"); e.Subject = "Join.me Meeting w/ " + "{! Contact.FirstName}" + " " + "{! Contact.LastName}"; e.ActivityDate = "{! NOW()}"; e.DurationInMinutes = 30; e.WhoId = "{! Contact.Id}"; e.JoinmeV2__Join_Me_Activity__c = true; e.JoinmeV2__Meeting_Code__c = "thewealthpool"; //sforce.connection.create([e]); var win = window.open('https://www.join.me', '_blank'); win.focus(); } </script> <apex:form > <apex:includeScript value="/soap/ajax/33.0/connection.js"/> <apex:includeScript value="/soap/ajax/33.0/apex.js"/> <apex:commandbutton image="{!URLFOR($Resource.JoinMeLogo)}" onClick="openPage()"/> </apex:form> </apex:page>
Abdul Khatri
please update your code with these lines. ActivityDateTime is mandatory for Event.