我有一个问题,有这个事件。我的目的是什么:我想根据一些标准更新一个属性,所以我想要填充一个字段a,如果字段a为空,字段b不为空,字段c也不为空。

如何正确地做到,因为在itemupdating的情况下,一些后助剂有时是null,或者它们在所有等等等等。

任何好的建议? 只是为了让你知道它是关于 sharepoint 2007

更新:问题是我需要比较以前的值和新值:所以如果有人更新项目。

前: 当前项目:标题= value1; title2= value1

某人相应更新:title= newvalue

更新的项目应具有以下值:title= newValue; title2= newValue

下次更新以下时间:title2= iplaceAnewvalue;

更新的项目应该是follwoing:title= ipriceanewvalue; title2= iplaceanewvalue; 所以基本上,两个字段都应该保持同步的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
    }
}
许可以下: CC-BY-SA归因
scroll top