存档InfoPath列表 [英] Archive InfoPath list

查看:81
本文介绍了存档InfoPath列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个自定义的Infopath表单,其中包含大约32,000条记录.我想根据列表中的条件和创建的日期将此信息路径列表归档到另一个列表.由于源列表很大,因此我希望将存档列表添加到文件夹中的内容. 信息路径项也包含附件.

I have a custom Infopath form which has around 32,000 records. I want to archive this infopath list to another list based on conditions in the list and based on created date. Since the source list is huge, I want the archived list to contents inside folder. The infopath item contains attachment as well.

示例:基于创建的日期2/13/2017和status =已完成",然后在存档列表中将文件夹创建为"Feb17".以及源列表中所有创建日期为"2/13/2017"的项目且其状态已完成 应该移到该文件夹​​.

Example: based on created date 2/13/2017 and status="completed" , then in archive list a folder has to be created as "Feb17" and all items in source list having created date as "2/13/2017" and whose status is completed should be moved to that folder.

此外,当将项目移动到存档列表时,打开项目时可以在Infopath中打开那些已存档的项目吗?

Also, when items are moved to archive list, can those archived items be opened in Infopath, when opening the item?

如何归档InfoPath表单?

How to archive InfoPath form?

谢谢

推荐答案

Venkatzeus,

Hi Venkatzeus,

据我了解,如果要将条件项归档到新列表中的文件夹中,我们可以使用SharePoint对象模型通过CAML查询获取项目,然后移动到新的列表文件夹.

As I understand, if want to archive conditional items a folder in a new list,  we can use SharePoint Object Model to get the items with CAML Query and then move to the new list folder.

关于以编程方式使用CAML的查询项,下面是一个演示供您参考:

About query items with CAML programmatically, here is a demo for your reference:

http://www.c-sharpcorner.com/blogs/working-with-spquery-and-caml1

以下是有关将文件项移至另一个库供您参考的代码段:

Here is a code snippet about move file item to another library for your reference:

public void Movefiles(destlibUrl)
{
SPWeb web = SPContext.Current.Web;
SPFolder oFolder = web.GetFolder("Source Library");
SPFileCollection collFile = oFolder.Files;

//Copy the files to a generic List of type SPFile
List listFiles = new List(collFile.Count);

foreach (SPFile oFile in collFile)
{
listFiles.Add(oFile);
}

// Enumerate the List and move the files into the Destination library.
foreach (SPFile moveFile in listFiles)
{
moveFile.MoveTo("destlibUrl/" + moveFile.Name, true);
}
}

谢谢

最好的问候


这篇关于存档InfoPath列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆