方法示例:
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() : "";
            }

相关文章:

  • 2021-10-31
  • 2022-12-23
  • 2021-11-13
  • 2022-12-23
  • 2021-10-03
  • 2022-12-23
  • 2022-12-23
  • 2021-05-26
猜你喜欢
  • 2022-12-23
  • 2021-10-11
  • 2021-06-29
  • 2022-12-23
  • 2021-12-08
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案