function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
shivdhanshivdhan 

Problem while inserting event in Salesforce Calendar

Hi All,

I am trying to create event record to Salsforce calendar then i get following error.Please help to resolve this error.

 

Upsert failed. First exception on row 0; first error: UNKNOWN_EXCEPTION, invalid parameter value: []

Error is in expression '{!AddtoSalesforce}' in component <apex:page> in page busivents:calendar


An unexpected error has occurred. Your development organization has been notified.

 

Thanks

Shivani

harsha__charsha__c

Hi

 

Can you paste the code of "AddtoSalesforce" method. So the error can be identified..!

shivdhanshivdhan

Hi

This is my code

Event e = new Event();
e.subject='test';
e.Description ='des';
e.Location='Delhi';
e.StartDateTime= datetime.now();
e.EndDateTime = datetime.now();
//e.DurationInMinutes= 18;
e.activitydate=e.StartDateTime.date();
upsert e;

 

When I am writing this code in developer console then it is working fine and creating an event in salesforce calendar but when i am using same code in a method then it is generating  an error which i have mentioned earlier.