When does onEventAdded get called?

Hi,

Just wondering does onEventAdded get called just before the event actually gets added? Is there an event that I could call just after the event is added that takes the same arguments (event_id,event_object)?

Thank you for your help,
Alexa

onEventAdded get called when event is created ( fully created, details form filled, creation confirmed )

just after the event is added
if you need to intercept moment when event created but not confirmed yet - you can use onBeforeEventChanged handler

What is happening is I am calling the onEventAdded event, which I am using to add multiple events spaced a week apart (Similar the code in this post viewtopic.php?f=6&t=13809). I am not actually using the recurring extension though.
When the events are added to the database it seems to add the events called by the onEventAdded event handler first, then it adds the event that called onEventAdded last - so it is getting the last event id.

I was just wondering if this was because onEventAdded was getting called before the data is actually being committed to the database. What I might do is just delete the original event, as has been mentioned in that other forum post, and have it created in the onEventAdded function.

Thanks for your help as always.

if this was because onEventAdded was getting called before the data is actually being committed

Yes, the event is called when main event is still in saving process.
Actually this is depends on order of initialization code, if you are attaching custom handler AFTER dp.init command, then your custom code will be executed when master event data already sent to DB.