[英]Remote Event Receiver-How to get attachment of list item before updating or adding list item
我想添加限制以在列表項中僅上傳一個附件。 我實現了附件添加事件,但如果用戶刪除第二個附件,我將無法獲得最新的附件計數。
您可以使用以下 CSOM 代碼檢查附件計數:
List targetList = clientContext.Web.Lists.GetByTitle("List Name");
ListItem oItem = targetList.GetItemById(1);
AttachmentCollection oAttachments = oItem.AttachmentFiles;
clientContext.Load(oAttachments);
clientContext.ExecuteQuery();
Console.WriteLine(oAttachments.Count)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.