FIELD_INTEGRITY_EXCEPTION: An event can’t last longer than 14 days exception occurs when the difference between Start Date/Time and End Date/Time is greater than 14 days.
Sample Code:
- Event objEvent = new Event(Subject = ‘Test’, StartDateTime = System.now(), EndDateTime = system.now().addDays(15));
- insert objEvent;