本文介绍了为要复制的所有列创建工作流的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!

我希望我可以在您的帮助下归档以下内容:-)

I hope i can archive the following with your help :-)

我有一个大"的约120列的列表(列表A).

I have a "large" list (List A) with about 120 columns.

第一列是一个简单的文本字段(Colume A.1),其后的119是是/否字段.

The first column is a a simple text field (Colume A.1), the following 119 are yes/no fields.

第二个列表(列表B)具有2列:两个文本字段.

A second list (List B) has 2 columns: two text fields.

我在寻找什么

如果列表A中的值是是",则返回0. (或true ...)文本字段值(值A.1)和yes/no列的columne标头应复制到列表B.

If a value in List A is "yes" (or true...) the text field value (Value A.1) and the columne header of the yes/no column should be copied to List B.

示例:

添加或更改此列表中的一行后(从yes到no,反之亦然),列表B应该如下所示:

After a row in this list is added or changed (from yes to no and vis verse) List B should look like that:

我知道我可以用119个条件和119个动作创建一个工作流,但是列数一直在变化,所以我需要一个动态的解决方案.

I am aware that I could make a workflow with 119 conditions an 119 actions, but the count of columns is constantly changing, so I need a dynamic solution.

感谢您的帮助!

CS

推荐答案

如果列数不断变化,我们可以创建事件接收器来实现它.使用服务器对象模型获取列表字段(https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spfieldcollection.aspx )  在循环中添加一些条件(foreach).检查前后值,我们可以使用如下代码:

If the count of columns is constantly changing, we can create event receiver to achieve it. Get list fields using Server Object Model(https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spfieldcollection.aspx) and add some conditions in the loop(foreach). Check the before and after value, we can use the code like this:

if(properties.ListItem["column"] != properties.AfterProperties["column"])
{
    //some code
}

更多信息:

在SharePoint 2013中创建简单事件接收器

http://www.c-sharpcorner. com/UploadFile/5b1f04/creating-simple-event-receiver-in-sharepoint-2013/

最好的问候,

丹尼斯


这篇关于为要复制的所有列创建工作流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 14:31