zoukankan      html  css  js  c++  java
  • RetrieveAttributeChangeHistoryRequest 检索对特定属性所做的全部更改

    方法示例:
    var attributeChangeHistoryRequest = new RetrieveAttributeChangeHistoryRequest
    {
    Target = new EntityReference(
    entity.LogicalName, entity.Id),
    AttributeLogicalName = "new_status_lc"
    };

                var attributeChangeHistoryResponse =
                    (RetrieveAttributeChangeHistoryResponse)plugin.SysService.Execute(attributeChangeHistoryRequest);
    
                // Display the attribute change history.
                AuditDetailCollection details = attributeChangeHistoryResponse.AuditDetailCollection;
                if (details != null && details.Count > 1 && details[0] != null)
                {
                        Type type = details[0].GetType();
                        Entity oldValueEntiy = type.GetProperty("OldValue").GetValue(details[0], null) as Entity;
                        Entity newValueEntity = type.GetProperty("NewValue").GetValue(details[0], null) as Entity;
                        auditValue.OldValue = oldValueEntiy.Contains(field) ? oldValueEntiy.GetAttributeValue<Money>(field).Value.ToString() : "";
                        auditValue.NewValue = newValueEntity.Contains(field) ? newValueEntity.GetAttributeValue<Money>(field).Value.ToString() : "";
                }
    人生短短数十载,最要紧的是满足自己,不是讨好他人。 ——亦舒《美丽新世界》
  • 相关阅读:
    iphone6闪存检测
    knowledges address
    类linux系统/proc/sysrq-trigger文件功能作用
    iphone 6s pp助手 越狱
    C pointers
    ubuntu15.04 TLS
    ubuntu cenots 禁止本地登陆
    CentOS7
    CentOS7安全设置 yum-cron系统自动更新,firewalld防火墙简单使用
    SAS学习笔记之函数应用
  • 原文地址:https://www.cnblogs.com/jerrys/p/15494220.html
Copyright © 2011-2022 走看看