0
如果itemupdated事件在它後面觸發,我需要跳過itemadded事件中的代碼。有沒有共同的解決方案?如何在itemadded事件中檢查itemupdated事件是否會在之後觸發?
如果itemupdated事件在它後面觸發,我需要跳過itemadded事件中的代碼。有沒有共同的解決方案?如何在itemadded事件中檢查itemupdated事件是否會在之後觸發?
只需刪除itemadded然後。 Itempupdated總是被觸發,即使該項目剛創建。所以我不明白你爲什麼需要ItemAdded。
itemupdated事件不觸發每次。它僅在需要檢查選項啓用時觸發。 https://www.simple-talk.com/dotnet/.net-tools/managing-itemupdating-and-itemupdated-events-firing-twice-in-a-sharepoint-item-event-receiver/ – mojo
當我們改變時文件元數據或添加到庫後的內容。當我們將文件添加到庫時可能會很正確。 – mojo
我找不到如何跳過itemadded事件,但我發現如何檢查itemupdate事件是否在itemadded事件之後被寫入,因此我可以在itemupdate中撤消對其的更改。有SPItemEventProperties.Versionless屬性可以做到這一點。以下是源http://sharepointbulletin.blogspot.com/2013/08/preventing-multiple-events-from.html – mojo