sharepoint - Document library field wont update field value -
on itemadded on field,
public override void itemadded(spitemeventproperties properties) { this.eventfiringenabled = false; using (spweb web = new spsite(properties.weburl).openweb()) { splist list = web.lists[properties.listid]; splistitem item = list.getitembyid(properties.listitemid); var test = item["myfield"] = ""; item.systemupdate(false); } this.eventfiringenabled = true; } } }
when adding dokument directly library clear field, men when publish document , try unpublish , select remove document create draft of document, on event wont clear field, value , in en still has old value?
i've not checked sure think remember when dealing event receivers in document libraries it's little funny. believe itemadded event fires when upload document, continue fill out metadata document , when click save itemupdating , itemupdated event fired. if debug see think.
i believe want change itemupdated
cheers
truez
Comments
Post a Comment