public onActionBegin(args: ActionEventArgs): void {
//Store recurrence in the DB and get the primary key id from DB
this.someService.createRecurrence(this.someModel).then( (response)=>{
let data:Object=new DataManager(this.scheduleObj.getCurrentViewEvents()).executeLocal(new Query().where('RecurrenceID', 'equal', args.addedRecords[0]['Id'])); //Find recurrence which was just created
data[0].Id = response['id']; // Re-assign the ID obtained from the DB to the recurrence that just got created
this.scheduleObj.saveEvent(data[0], 'EditOccurrence'); //Save changes
console.log('before then:' + JSON.stringify(this.scheduleObj.getEvents())) //Id doesn't change even after updating
});
}