Nic Oughton

I am trying to update a field with a value when a new item is added to a document library.

I am using the ItemAdded event with the following simple test code :

public override void ItemAdded(SPItemEventProperties properties)

{

SPListItem itm = properties.ListItem;

itm["Title"] = "Fred";

itm.Update();

}

I have found that if I upload an item the the field value gets populated but if I create a new item then it doesn't.

I have also found that when I create a new item I get te following error in the Event Viewer

Error loading and running event receiver ListItemReceiver.ListItemReceiverHandler in

ListItemReceiver, Version=1.0.0.0,

culture=neutral, PublicKeyToken=c40a7d261d8139e9

. Additional information is below.

: The event does not support change of properties.

Anyone have any ideas why this codes works when an item is created one way and not the other

All suggestions gratefully received as this problem is consuming way to much time and driving me mad !


Re: SharePoint - Development and Programming ItemAdded Event Not Always Firing

GBelzile

Did you find your answer I'm stuck in the same situation...

Thanks





Re: SharePoint - Development and Programming ItemAdded Event Not Always Firing

BizWorld

check the Status of ListItem.File.CheckOutStatus etc if it is not checked out then do a check out and after update, perform check and publish, approve sequence as well.