UpdateMode on SaveAppointmentEntity in CRM Script?

Hi there

 

So, i have been working on a project that includes a seperate calendar for a customer with SuperOffice, and i have been using CRM Script for that.

I need to emulate the functionality of recurring activities, which in principle works fine - there is however no way to set RecurrenceUpdateMode on NSAppointmentAgent.SaveAppointmentEntity.

I can only set this on NSAppointmentAgent.Save - which allows me to save NSAppointment and not the NSAppointmentEntity...

 

So i'm not really sure what to do here - i'm unable to create a new appointment without using CreateDefaultAppointmentEntity - and thereby using AppointmentEntity for both creating and updating an appointment - but when working with recurrence, i need to be able to set RecurrenceUpdateMode somehow - is it somehow forgotten to be put into the NSAppointmentEntity in CRMScript, or am i attacking this the wrong way??

Thanks for your help, i'm a bit stuck. :(

RE: UpdateMode on SaveAppointmentEntity in CRM Script?

Hello Dennis,

You can use the .Save method to specify an RecurrenceUpdateMode 

Sample:

NSAppointmentAgent appointmentAgent;
NSAppointmentEntity appointmentEntity;

// 1: Update only this instance
// 2: Update this instance and all instances forward in time
// 9: Stop the recurrence from this instance and forward in time 
Integer updateMode = 1;

Bool sendEmailToParticipants = false;

NSEMailConnectionInfo connInfo;

appointmentAgent.Save(appointmentEntity, updateMode, sendEmailToParticipants, connInfo, connInfo);
By: David Hollegien 19 Feb 2021

RE: UpdateMode on SaveAppointmentEntity in CRM Script?

Woops, should've looked more closely - i've been looking at that function 40 times and was convinced every time that it took an NSAppointment object as a parameter for some reason - my bad, i need my glasses checked.  

Billedresultat for awkward smiley

 

Thanks for the help!!

By: Dennis Mortensgaard 20 Feb 2021