Hi.
i always have to get the SPUser object and i always forget so i guess i will document it so i can refer back to it .... here goes ..
SPUser spUser = null;
SPFieldUser field = itemEvent.Fields.GetFieldByInternalName("Author") as SPFieldUser;
if (field != null && itemEvent["Author"] != null)
{
SPFieldUserValue fieldValue = field.GetFieldValue(itemEvent["Author"].ToString()) as SPFieldUserValue;
if (fieldValue != null)
{
spUser = fieldValue.User;
}
}
Nice and simple ...and works like a charm ... :)
Bradley
HEHE, thx Bradley
ReplyDeleteGiellie
You save my time. Thanks a lot :)
ReplyDeletePerfect! Thanks
ReplyDeleteI lost 1/2 day to find your post. Thanks a million !
ReplyDeleteThomas