I have an event receiver that runs when metadata on a folder (docset) is updated. In the same event receiver, I want to run kick off an event receiver for each document in the folder. What I want to know is: is it possible to call an event receiver using a different SPitemEventProperties than the one given.

e.g.

public override void ItemUpdated (SPItemEventProperties properties) {
// when properties is/contains a folder:
// on each document in the folder
// run ItemUpdated where properties is a/contains a document
}

Is it possible to do this? If so, any ideas?

有帮助吗?

解决方案

Short answers: no. There is possibly a really hacky way to do it but no obvious solution.

For my particular situation, it was easier to setup the environment so the document inherits the changing piece of metadata so it's event receiver fires when this column changes. Hope it helps someone else in the future, or for my own records if no one else reads this.

其他提示

You can call SPListItem.Update() on each document folder ItemUpdatedER. This run document EventReceiver.

public override void ItemUpdated (SPItemEventProperties properties) {
    query all sub items/documents
    on each document change your data:
    item["customField"] = "update value";
    item.Update() //call recursively ItemUpdating/ItemUpdate
 }
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top