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