深入浅出Nintex——新增、更新和删除列表中的条目

本文介绍了如何使用Nintex工作流进行列表项的新增、更新及删除操作,并提供了具体的XML代码示例,帮助读者更好地理解和应用。

新增(New)

 


  
< Batch PreCalc ='TRUE' OnError ="Continue" >
< Method ID ="1" Cmd ="New" >
< Field Name ='ID' > New </ Field >
< Field Name ='ID' > Mingle </ Field >
</ Method >
</ Batch >

 

 

 

 

更新(Update)

代码

   
< Batch OnError ="Continue" ListVersion ="1" >
< Method ID ="1" Cmd ="Update" >
< Field Name ='ID' > {WorkflowVariable:ItemID} </ Field >
< Field Name ='Current_x0020_Days_x0020_Taken' > {WorkflowVariable:iDaysTakenYTD} </ Field >
< Field Name ='Days_x0020_Accrued_x0020_YTD' > {WorkflowVariable:iDaysAccrued} </ Field >
< Field Name ='Current_x0020_Accrual' > {WorkflowVariable:iCurPeriodEntitlement} </ Field >
< Field Name ='Days_x0020_Remaining' > {WorkflowVariable:iCurDaysBalance} </ Field >
< Field Name ='Days_x0020_Carried_x0020_Over' > {WorkflowVariable:iDaysCarriedOver} </ Field >
</ Method >
</ Batch >

 

使用WebRequest来更新InfoPath文件的内容

 

代码

   
<? xml version="1.0" encoding="utf-8" ?>
< soap:Envelope xmlns:xsi ="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd ="http://www.w3.org/2001/XMLSchema" xmlns:soap ="http://schemas.xmlsoap.org/soap/envelope/" >
< soap:Body >
< UpdateListItems xmlns ="http://schemas.microsoft.com/sharepoint/soap/" >
< listName > {Common:ListName} </ listName >
< updates >
< Batch OnError ="Continue" >
< Method ID ="1" Cmd ="Update" >
< Field Name ="ID" > {ItemProperty:ID} </ Field >
< Field Name ="FileRef" > {Common:WebUrl}/{Common:ListName}/{Common:ItemDisplayName}.xml </ Field >
< Field Name ="BaseName" > test </ Field >
</ Method >
</ Batch >
</ updates >
</ UpdateListItems >
</ soap:Body >
</ soap:Envelope >

 

 

删除(Delete)

 


  
< Batch PreCalc ='TRUE' OnError ="Continue" >
< Method ID ="1" Cmd ="Delete" >
< Field Name ='ID' > {WorkflowVariable:ItemID} </ Field >
</ Method >
</ Batch >

 

If you need to delete  an item  from a document library you will need to use CAML and only the URL of the document should be sufficient

<Batch OnError="Continue"> <Method ID="1" Cmd="Delete">  <Field Name="ID">1</Field>  <Field Name="FileRef">http://{servername}/{LibraryName}/document.xml</Field> </Method></Batch> 

If you are trying to delete an item inside a list  then you nedd to ahve the id an you can construct the caml something like this\

<Batch OnError="Continue"> <Method ID="1" Cmd="Delete">  <Field Name="ID">1</Field> </Method></Batch> 
扩展阅读: http://connect.nintex.com/forums/thread/6929.aspx

转载于:https://www.cnblogs.com/mingle/archive/2010/11/27/Nintex_UpdateListItems.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值