Does it open the same item in all content editors, or different items
(maybe this is a result of default children in your master?).
You may want to use item:added instead of item:created
(http://sdn5.sitecore.net/FAQ/API/added%20or%20created%20event.aspx)
or you may have to fall back to item:saved.
Sitecore.DateUtil.IsoNow seems to provide a convenience for getting
the system date in the required format.
I just tested with a master which had a child, both based on the same
template which had a field named ItemCreationDate. I used the
following configuration and code. I did not experience any issues
using 5.3.2 071220 - the field was populated for both items and no new
content editor windows opened.
<event name="item:created">
<handler type="Global.Events.ItemEventHandler, Global"
method="OnItemCreated">
<FieldName>ItemCreationDate</FieldName>
</handler>
</event>
using System;
namespace Global.Events
{
public class ItemEventHandler
{
private string _fieldName = null;
public string FieldName
{
get { return (_fieldName); }
set { _fieldName = value; }
}
public void OnItemCreated( object Sender, EventArgs args )
{
Sitecore.Diagnostics.Assert.IsNotNull(_fieldName, "Field
name not provided" );
Sitecore.Data.Events.ItemCreatedEventArgs cArgs =
Sitecore.Events.Event.ExtractParameter(args, 0) as
Sitecore.Data.Events.ItemCreatedEventArgs;
if (cArgs != null && cArgs.Item != null &&
cArgs.Item.Fields[FieldName] != null &&
String.IsNullOrEmpty(cArgs.Item.Fields[FieldName].Value))
{
cArgs.Item.Editing.BeginEdit();
cArgs.Item.Fields[FieldName].Value =
Sitecore.DateUtil.IsoNow;
cArgs.Item.Editing.EndEdit();
}
}
}
}