Skip to main content
Post Reopened by Chris Duncombe, Keith C, Samuel De Rycke
added 829 characters in body
Source Link

Can anyone provide me sample apex code to create recurring event in salesforce.

I am using below code:

Event newEvent = new Event();
newEvent.OwnerId = '023170000004yO9AAI';
newEvent.Subject ='Test';
newEvent.WhatId = recordId;
newEvent.IsRecurrence = true;
newEvent.RecurrenceStartDateTime = System.today();
newEvent.RecurrenceEndDateOnly = System.today()+30;
newEvent.RecurrenceType = 'RecursDaily';
newEvent.IsAllDayEvent =true;
newEvent.DurationInMinutes =1440;
newEvent.ActivityDate = yagyaPerformanceObj.Start_Date__c;
insert newEvent;

I am using above code to create recurring event. My requirement is to create recurring event for 30 days which recurs daily. I am getting this error 'REQUIRED_FIELD_MISSING, Required fields are missing: [Recurrence Interval]: [Recurrence Interval]'

I don't know which field I am missing.

Can anyone provide me sample apex code to create recurring event in salesforce.

Can anyone provide me sample apex code to create recurring event in salesforce.

I am using below code:

Event newEvent = new Event();
newEvent.OwnerId = '023170000004yO9AAI';
newEvent.Subject ='Test';
newEvent.WhatId = recordId;
newEvent.IsRecurrence = true;
newEvent.RecurrenceStartDateTime = System.today();
newEvent.RecurrenceEndDateOnly = System.today()+30;
newEvent.RecurrenceType = 'RecursDaily';
newEvent.IsAllDayEvent =true;
newEvent.DurationInMinutes =1440;
newEvent.ActivityDate = yagyaPerformanceObj.Start_Date__c;
insert newEvent;

I am using above code to create recurring event. My requirement is to create recurring event for 30 days which recurs daily. I am getting this error 'REQUIRED_FIELD_MISSING, Required fields are missing: [Recurrence Interval]: [Recurrence Interval]'

I don't know which field I am missing.

Post Closed as "Needs details or clarity" by Daniel Hoechst, Chris Duncombe, metadaddy
Source Link

Apex Code to create recurring event salesforce

Can anyone provide me sample apex code to create recurring event in salesforce.