How to – Use RetrieveAttributeChangeHistoryRequest to get audit data for an attribute (Dataverse/ Dynamics 365/ CRM)

We can use RetrieveAttributeChangeHistoryRequest to get the change history of a particular field / attribute of a record.

We need to set the Target and the AttributeLogicalName property of the request.

AuditDetails records of the RetrieveAttributeChangeHistoryResponse contains the detail of the audit records.

The Audit History records in CRM- 

AttributeAuditDetail contains the details of the changes made on the field’s value. It contains property like – objectid, userid, operation etc. as well as new value and the old value as shown below.

Sample Code (C#) 

 string ConnectionString = "AuthType = OAuth; " +
                  "AppId=51f81489-12ee-4a9e-aaae-a2591f45987d; " +
                  "; " +
                  "Password=*******; " +
                  "RedirectUri=app://58145B91-0C36-4500-8554-080854F2AC97;" +
                  "Url =;";

            CrmServiceClient svc = new CrmServiceClient(ConnectionString);

            if (svc.IsReady)

                var attributeChangeHistoryReq = new RetrieveAttributeChangeHistoryRequest();

                attributeChangeHistoryReq.Target =
                    new EntityReference("incident", new Guid("0a9f62a8-90df-e311-9565-a45d36fc5fe8"));
                attributeChangeHistoryReq.AttributeLogicalName = "prioritycode";

                var attrChangeResponse = (RetrieveAttributeChangeHistoryResponse)svc.Execute(attributeChangeHistoryReq);
                var auditDetailCollection = attrChangeResponse.AuditDetailCollection;

                foreach (var auditDetails in auditDetailCollection.AuditDetails)
                    // Type =  AttributeAuditDetail, AuditDetail, 
                    var type = auditDetails.GetType();

                    if (type == typeof(AttributeAuditDetail))
                        var attributeDetail = (AttributeAuditDetail)auditDetails;

                        var userName = attributeDetail.AuditRecord.GetAttributeValue<EntityReference>("userid").Name;
                        var operation = attributeDetail.AuditRecord.FormattedValues["operation"];
                        var action = attributeDetail.AuditRecord.FormattedValues["action"];
                        var createdOn = attributeDetail.AuditRecord.GetAttributeValue<DateTime>("createdon");
                        var newValue = attributeDetail.NewValue.FormattedValues["prioritycode"];
                        var oldValue = attributeDetail.OldValue?.FormattedValues["prioritycode"];


Check other posts on Audit

Hope it helps..


Modern link sharing UI, co-presence, online status (preview) in the model-driven app (Dynamics 365)

To enable the Collaboration preview feature, log in to the Power Platform Administration Center, select the Environment >> Settings >> Features >> Collaboration

Currently, the following entities are supported – Case, Contact, Account, and Opportunity.

Enabling this feature adds a new section in the command bar for the records, that allows us to see the other users working on the same record.

Here we can see 2 other users working on the same contact record.

We can select the user’s picture to see their status, send an email, start teams chat, and open the contact card.

Send Email opens the default mail app with To populated.

Teams chat opens the team for a chat.

Open contact card opens the contact’s card.

Share allows emailing the link of the current record and sharing the record.

Email link

Clicking on Manage access opens the share records dialog.

Get all the details here –

Also check – Collaborate using comments –

Hope it helps.. 


Understanding Queues in Dynamics 365 Customer Service (refresher)

  • What are Queues?

Queues are containers to store, organize, prioritize and monitor the progress of work items or queue items.

  • Which entity/table can be enabled for the queues?

All customizable entities can be enabled for queues.

Below we are enabling it for the lead entity.

Enabling it for the lead now allows lead records to be added to the queue.

  • By default, which entities are enabled for Queue?      Appointment, Campaignactivity, CampaignResponse, Email, Fax, Incident. Letter, PhoneCall, RecurringAppointmentMaster, ServiceAppointment, SocialActivity, Task
  • How do we create a Queue?

A queue is automatically created for each user and team. They can also be referred to as system queues as they are created by the system.

Below is the Queue created for each of the users.

User Queue –

Team Queue

The Team queue will have the same members as in the team.

Adding and removing the members from the Team will add and remove the members from the Queue also.

However it is not vice versa, that is, adding or removing members from the queue will not remove it from the team.

Here we are removing User 5 from Team’s queue –

On removing the member from the queue, the member is still there in the Team.

Adding user 6 in the Team will add it to the queue’s member.

The above automatically created queue is of type Private.

The private queue for the user is only available to the user and the private team queues are visible to only the team owner and members of that team.

  • What are the different types of queues?

The queue can be either of type private or public.

Public queues are available across the application and are created when you need work to be acted upon across the different users, unlike Private queues whose queue items are only accessible to the members of that queue.

E.g. one public queue can be created for high-priority cases, others could be for lesser priority items or there could be different public queues based on geography or product.

  • How do we create queues?

To create Queues, navigate to Service Management >> Queues in Customer Service.

Select New.

Below we have created a Public Queue.

Notice that we do not have the option to add members to a public queue, unlike a private queue.

Also, incoming email value can be specified for the queue, and based on the email settings – queue items would be created for the mail received.

Check below article for more details on the same –

  • Now with the queue created private and public both, how do we add records/items to it?

Say we want to add a particular lead record, here we can navigate to view for the lead or open an individual lead record and select the option Add to Queue

By default, it loads the Business Queues

Below are the other Lookup Views available –

Let us assign it to the My Sample Public Queue we created earlier.

Back in the Queues area, we will have Items I am working on System View and Queues I’m a member of filter set by default.

As those are lead records are not yet picked for working on them, they are not available in the above view.

Let us change it to either All Items or Items available to work on and filter to either My Sample Public Queue, All Queues, or All Public Queues for the lead records / queue item to show up.

We can see the queue items (lead records) available to work on.

  • How can we change the default view for the Queue Items?

By using the Set current view as my default option.

  • Can we create more system views or hide the existing ones?

Yes navigate to View (Queue Items) inside the customization area, from there we can create new views, edit, activate, deactivate existing views.

E.g. we can create a new public view, that has filter criteria to show only the records of type lead.

  • How do we pick the items from the queue to work on?

Using the Pick command.

  • What happens when we pick a record from the queue?

A dialog box appears which informs that the item will be assigned to you and also the option to remove the item(s) from the queue.
Here we have selected the lead record with Title – Kim Abercrombie.

Let us leave it at No and click on Pick.

We can see the owner getting updated.

And the below details in the queue item record.

Worked by, Entered Queue and Modified on details updated.

And also as we had opted No for Remove the item from the Queue.

The item will be available on All Items view, but won’t be available on Items available to work on.

  • What happens when we Release the Item?

A dialog box appears that informs that the item will be assigned back to the queue’s owner and other members can pick up.

As expected the Item is added back to the queue.

And the Worked By field is set as blank for the queue item.

Also, the owner of the record is set to the queue owner.

  • What happens when we Remove the record instead of the Release command?

Now let us pick the same lead record again, and this time we will Remove it instead of Release.

This Remove option removes the Queue Item (a lead record) from the Queue. (My Sample Public Queue) in this case.

On checking the Queue Item Details for the record, we will get the below message.

Get all the details here –

Also check –

Hope it helps..


Collaborate using Comments (preview) in Modern App Designer – Power Apps / Dynamics 365

A new comments (preview) feature has been added recently in the Modern App Designer

Modern App Designer

To see it in action, open an existing app or create a new app using the Modern App Designer.

We can see the Comments (preview) options in the toolbar.

Comments allow us to add notes, discuss with colleagues using mention etc.

We can add multiple comments and it shows the count.

The comments can be edited, deleted, and resolved.

This is how the resolved comment look like – disabled 

We can add comments to the page of type  – view, form, dashboard, and custom page.

We can add comment also within the Navigation bar.

Currently, mention is not listing any suggestions –

Check here for more such features added –

Hope it helps..


Fixed: Action not appearing in Plugin Registration tool (Dynamics 365 / CE)

We had couple of actions created, but they were not appearing in the Plugin Registration Tool Plugin of XrmToolBox as shown below.

Refreshing the plugin, re-connecting to the organization, republishing the action, etc. didn’t work.

Eventually, we restarted the XrmToolBox and our messages started appearing.

Could be something related to Metadata cache.

Hope it helps..


Fixed – Unified routing was unable to provision error while trying to configure Unified routing

Recently while trying to set up Unified Routing, we got the below error.

“Unified routing was unable to provision. Please try again or contact Microsoft Support”

The user had the system administrator role and we already had the global administrator’s consent, which should be good enough to set up unified routing.

We tried with different system administrator users but that doesn’t resolve that error.

Eventually, we tried the setup with the same user but in a different VDI (Virtual Desktop Infrastructure), and the setup worked properly without any error. One probable reason could be, that the appropriate URLs being accessed during setup were already whitelisted in the other VDI, which wasn’t the case in the first VDI where we were trying.

Hope it helps..

%d bloggers like this: