Sharepoint远程事件接收器更改项目的字段

编程入门 行业动态 更新时间:2024-10-19 15:35:49
本文介绍了Sharepoint远程事件接收器更改项目的字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在列表/库的远程事件接收器中是否有可用的属性,我们可以在更新时检查哪个字段已更改?

In Remote event receiver for the list/library is there any property available where we can check which field has changed for Item while updating?

我尝试了 properties.ItemEventProperties.AfterProperties,但它获取了所有字段而不是仅更改字段

问候,

Prera​​k Desai

推荐答案

Hi Prera​​k,

Hi Prerak,

要确定SharePoint Remote Event Receiver中哪个字段已更改,它是必须将更新的字段值与 ItemUpdating 事件接收器中的原始值进行比较:

To figure out which field has changed in SharePoint Remote Event Receiver, it is necessary to compare the updated field value with the original value in ItemUpdating event receiver:

Uri myurl = new Uri(properties.ItemEventProperties.WebUrl); using (ClientContext clientContext = new ClientContext(myurl)) { if (clientContext != null) { List lstContacts = clientContext.Web.Lists.GetByTitle( properties.ItemEventProperties.ListTitle ); clientContext.Load(lstContacts); clientContext.ExecuteQuery(); int cnt = lstContacts.ItemCount; ListItem item = lstContacts.GetItemById(cnt); clientContext.Load(item); clientContext.ExecuteQuery(); var oldTitle = item["Title"].ToString(); var newTitle = properties.ItemEventProperties.AfterProperties["Title"].ToString(); if (oldTitle != newTitle) { //The title field has been changed } }

这是一个类似的线程供您参考:

Here is a similiar thread for your reference:

通过RER中的CSOM获取ItemUpdated事件中的属性

谢谢

最好的问候

更多推荐

Sharepoint远程事件接收器更改项目的字段

本文发布于:2023-11-27 21:52:57,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1639730.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:接收器   字段   事件   项目   Sharepoint

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!