Itempdating Property.
-
10-12-2019 - |
質問
このイベントで問題があります。私の目的は何ですか:私はいくつかの基準に基づいてプロパティの1つを更新したいので、フィールドAが空の場合はフィールドAを入力し、フィールドbが空でなく、フィールドcも空ではありません。
何らかの後のプロパティを入れることが時々NULLまたはそれらが存在することがあることがあるか、存在することがありません。
あらゆる良いアドバイス?
ちょうどあなたにそれを知らせるために sharepoint 2007
更新:問題は、前の値と新しい値を比較する必要があることです。そうしない場合は、アイテムを更新した場合は
ex: 現在のアイテム:title= value1; title2= value1
誰かがそれに応じて更新されます:title= newvalue
更新されたアイテムは以下の値を持つべきです:title= newvalue; TITLE2= NEWVALUE
次回の更新後:TITLE2= in insawValue;
更新されたアイテムは次のようになるはずです:title= windownewvalue; TITLE2= INSOWVALUE;
では基本的に両方のフィールドが同期されているNNOの問題を保持する必要があるため、どのフィールドが更新されたかを知ることができず、どちらのフィールドが更新されるかをわかりません..
を見ます
解決 3
Basically at the end I solved my issue myself.
Just by checking the listItem.AfterProperties["column"] and comparing them with ListItem["column"] and then setting the again to ListItem.AfterProperties["column"]= value;
他のヒント
Just one question: Is there a reason for not using ItemUpdated where all your field would have been updated with the fresh information?
In ItemAdding you must check both BeforeProperties and AfterProperties to be successful in this task.
In ItemAdded:
title2 = title
In ItemUpdated workflow:
//Only when there is a change in title/title2 columns if(title != title2) { //Meaning title has changed if(title.beforeProperties.Value == title2) { title2 = title } //Meaning title2 has changed else if(title2.beforeProperties.Value == title) { title = title2 } }