Home     |     MS SQL Server    |     MS SharePoint    |     MS Visual Studio    |     MS Certifications    |     MS CRM     |     MS Office    |     MSF


Cervo Technologies
The Right Source to Outsource

Microsoft Sharepoint Portal Server

Update property in ItemAdded event (moss2007)


Hi

I have an ItemAdded event handler on a Document Library. I want to update a
property (field) on the item added to a new value.

NB: I know the event handler is run (i can debug the handler)

public override void ItemAdded(SPItemEventProperties properties)
{
      //I have tried this but it does not work (but no exceptions)
      properties.AfterProperties["Number"] = "88888";

    //Another way but dont know the API or if it is correct
    SPListItem item = properties.ListItem["Number"];
    // update the value there somehow on item. But is this actual the column
it self and not the row?
    item.Update();

}

Looking forward to your input

Regards
Anders

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc