Is it possible to retrieve schema change information in Dynamics CRM online?

大兔子大兔子 提交于 2019-12-10 10:45:07

问题


When a custom entity is created, a field is added or changed, someone makes an out-of-box changes to metadata.

How to know who did it and when?

The same for the creation or modification from a UI form. The metadata in CRM doesn't seem to store that information.


回答1:


I think it is not possible to access information you're asking for. Such a information is not available in the on-premise CRM database and I suppose there is a similar situation with CRM Online




回答2:


Not exactly what you are looking for. But this will be a good starting point to achieve what you want.

Using RetrieveMetadataChangesRequest, we can get the schema changes like:

  • Adding a custom entity named sample_SampleEntityForMetadataQuery with a custom optionset attribute named : sample_ExampleOptionSet
  • ClientVersionStamp: 296646!10/22/2012 21:42:06
  • Adding an additional option to the sample_ExampleOptionSet attribute options
  • Deleting the sample_SampleEntityForMetadataQuery custom entity

--

Sample code can be found in MSDN/SDK.

 protected RetrieveMetadataChangesResponse getMetadataChanges(
                         EntityQueryExpression entityQueryExpression,
                         String clientVersionStamp,
                         DeletedMetadataFilters deletedMetadataFilter)
{
 RetrieveMetadataChangesRequest retrieveMetadataChangesRequest = new RetrieveMetadataChangesRequest()
 {
  Query = entityQueryExpression,
  ClientVersionStamp = clientVersionStamp,
  DeletedMetadataFilters = deletedMetadataFilter
 };

 return (RetrieveMetadataChangesResponse)_service.Execute(retrieveMetadataChangesRequest);

}


来源:https://stackoverflow.com/questions/41575510/is-it-possible-to-retrieve-schema-change-information-in-dynamics-crm-online

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!