How to – Delete Data Source in Dynamics 365 Customer Insights


While trying to delete a data source we might below error if we have already used it for Match and Merge for defining the customer profile.

“Couldn’t delete data source. To process, remove its entities from: Match, Merge.”

Click on Enrichment

Navigate to Match.

Here also we cannot remove the entities in Unify as we have already used them in Merge.

So let us navigate to Merge.

Select all the fields from the DataSource (CRMDataSource in our case) which we want to delete, and click on Exclude.

Save the changes.

Now navigate back to Match and we will get the option to remove the CRMDataSource.

However, we will still not see the option to save the change as we just have 2 entities there.

Here we can add a different data source’s entity, e.g. we added the contact from our test data source.

And saved the changes.

Now as the last step we need to remove the entity from the Map also.

Click on Edit fields and unselect the entity, followed by Apply.

Navigating back to Data Sources, we were able to delete the Data Source successfully now.

So in short, if we need to delete a data source, which we have configured for customer profile, we need to first remove its references from Merge, Match and than Map.

Hope it helps..

Advertisements

How to – Delete Audit data by entity / table, date, user access, and specify retention duration – updates in Dataverse (Dynamics 365 / CRM)


Recently we saw a new update in our sandbox environments with regards to Audits.

Login to Power Platform Admin Center, select an environment.

We can see a new section Auditing added.

Click on Delete logs allows us to –

  • Delete logs by Table

We can select the tables there.

  • Delete only access logs data.
  • Delete logs up to the selected date.

And now we can also manage or specify the retention duration for the audit log.

These are very useful updates to the Audit feature in the platform which more or less have been similar since CRM 3.0 days.

Check other posts on Audit – 

https://nishantrana.me/2021/08/31/audit-entity-table-few-key-points-dynamics-365-power-apps/

https://nishantrana.me/2021/05/17/how-to-export-the-audit-history-values-from-dynamics-365/

https://nishantrana.me/2018/10/08/using-kingswaysofts-cds-crm-source-component-to-get-audit-information-in-dynamics-365-ce-ssis/

How to – Use RetrieveAttributeChangeHistoryRequest to get audit data for an attribute (Dataverse/ Dynamics 365/ CRM) – Nishant Rana’s Weblog

Hope it helps..

Advertisements

How to – Import Data from Dataverse / CRM to Dynamics 365 Customer Insights


In the last post, we had set up the trial version of Dynamics 365 Customer Insights.

https://nishantrana.me/2022/01/26/how-to-set-up-dynamics-365-customer-insights-trial/

Currently, our trial instance has no data.

We can ingest data into Dynamics 365 Customer Insights from Microsoft Dataverse either using Microsoft Power Query (Dataverse Connector)

or Microsoft Dataverse import method.

The Microsoft Dataverse import method doesn’t copy the data into the Customer Insights / Audience Insights Data Lake, however, it doesn’t allow for Extract, Transform, Load (ETL) as in the case of Microsoft Power Query data source.

Select Audience Insights >> Data >> Data Sources >> Choose your import method – Microsoft Dataverse

Provide a name to the data source and click on Next.

Enter the Server address, Sign in, and click on Next.

Select the Entity, here we have selected the contact entity for now.

We can see the data source is being refreshed.

We have the option of stopping the refresh.

We are having 100 records in our contact entity inside CRM.

It took around 5 hours for the refresh to complete successfully.

We have the option of Edit, Refresh and Delete on the Data Source after the successful refresh.

We can see the contact entity available within Data >> Entities section

Clicking on contact, we can see the Attributes used and Data in it as well as the option to download the data.

The download will be downloading the first 100K records.

Now when it comes to creating a unified customer profile through (MMM) i.e. mapping, matching, and merging, it requires a minimum of 2 entities to be there, to generate the Customer Profile.

In the next post, we will import some sample contact data from a local excel file and use it for further configuring our customer profile.

How to – Import Data from local data files to Dynamics 365 Customer Insights

How to – Unify (Map, Match and Merge) Entities in Dynamics 365 Customer Insights

Hope it helps..

Advertisements

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; " +
                  "Username=User1@xxxx.onmicrosoft.com; " +
                  "Password=*******; " +
                  "RedirectUri=app://58145B91-0C36-4500-8554-080854F2AC97;" +
                  "Url = https://xxx.crm.dynamics.com//;";


            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..

Advertisements

How to – manage who can create environments in Power Platform


Through the Power Platform admin center, the administrator can control who can create an environment in the Power Platform.

Click on Gear Icon >> Power Platform settings

There we can specify who can create production and sandbox environments & trial environments.

Let us set it as Only specific admins and save the settings.

With this particular setting now only the following admins will be able to create environments.

Global admin, Dynamics 365 Admin, and Power Platform admins.

The non-admin user will get the below error

Your tenant’s administrators have disabled trial environment creation for non-admin users. You need permission to create a trial environment in your tenant

In case of Everyone, the below license determines who can create environments.

https://docs.microsoft.com/en-us/power-platform/admin/create-environment#who-can-create-environments

Hope it helps..

Advertisements

How to – change user’s business unit without removing the security roles in Dynamics 365 / PowerApps (EnableOwnershipAcrossBusinessUnits setting)


When we change the user’s business unit, all the current security roles of the users are removed and we need to assign the roles again to the user. This has always been the default behavior. 

Also check – Modernize Business Units –  https://nishantrana.me/2022/01/04/modernize-business-units-matrix-data-access-structure-record-ownership-across-business-units-preview-in-dynamics-365-dataverse/

For E.g. below user User 2 belongs to Business Unit – BU 1 and has the following security roles assigned.

Now changing the user’s business unit to BU 2

will remove all his security roles assigned.

We can now override this behavior by updating the new option /setting added

DoNotRemoveRolesOnChangeBusinessUnit(this property determines if roles are removed when the principal changes business units) through the
Organization Settings Editor tool

After we have installed the managed solution, we can update the setting and set it as true

Let us assign the security roles to User 2 in BU 2.

Let us now change the BU of user 2 back to BU 1.


As expected after updating that setting – DoNotRemoveRolesOnChangeBusinessUnit– as true – we can see the security roles still intact, even on the change of Business Unit for the user.

What happens if user 2 is assigned a security role – BU2 Security Role, which is created in BU 2 Business unit and is not available in BU 1.

Let us change the business unit to BU 1.

As expected BU2 security role is not available in BU 1, so that role is not assigned, only the common security role coming from parent BU remains intact.

Hope it helps..

Advertisements