cdscommon-data-servicedataverse

Enabling Change Tracking for Entity


Is there a way to enable change tracking for couple of entities programmatically? I could not find any api in Dataverse which can help to do this.


Solution

  • You cannot do that with webapi but you can definitely achieve this programatically.

    you can either create console application or you can run code now plugin for xrmtoolbox and get this done.

    Below code snippet for reference.

    UpdateEntityRequest updateBankAccountRequest = new UpdateEntityRequest
    {
         Entity = BankAccountEntity,
         ChangeTrackingEnabled = true //or false here
    };
    
    _serviceProxy.Execute(updateBankAccountRequest);
    

    Microsoft docs for ChangeTrackingEnabled