0
我編寫從CRM中檢索記錄並更新此記錄的應用程序。 但是,當我運行「service.Update(...)」,記錄是重複的(我在SQL Server數據庫中看到它)。 我想有從特定的Guid只有一個記錄,我現在有2在CRM 2011中更新記錄時避免重複C#
foreach (DataRow row in rsltFromSql.Rows)
{
ActivityMimeAttachment attachmentMimeTemp = new ActivityMimeAttachment();
try
{
attachmentMimeTemp = (ActivityMimeAttachment)handlerCrm.CrmService.Retrieve(ActivityMimeAttachment.EntityLogicalName, Guid.Parse(row["ActivityMimeAttachmentId"].ToString()), new ColumnSet(true));
}
catch (Exception ex)
{
/////
}
//delete body field
attachmentMimeTemp.Body = null;
//update the attachment with body = null
handlerCrm.CrmService.Update(attachmentMimeTemp);
attachmentMimeGuidList.Add(new Guid(row["ActivityMimeAttachmentId"].ToString()));
}
你有上ActivityMimeAttachment的更新執行任何其他插件或工作流?你在用attachmentMimeGuidList做什麼?你是否執行更新或創建其他地方? – Patrick 2015-04-23 16:47:38