Sample code to hide out of the box reports using ReportVisibility class in Dynamics 365


Recently we wanted to hide OOB reports for our users.

One way of doing it is either change those report from Organization owned to personal

or change the Display in Area for those reports (this will hide those reports from all other views except the “All Reports, Including Sub Reports” view), as all other OOB Views for the reports uses the Reports Area filter. Another option of course is to update the filter criteria for those views or deactivate those views.

In our case, we simply updated the Display In property for all the OOB reports. Below is the sample code that we used. Basically, every report can have 0 or more (max 3) related Report Visibility records associated to it. (i.e. for forms, lists or reports area). In the below code we have looped through all the OOB reports and deleted all the associated ReportVisibility records for that report.

Hope it helps..

Configuration Migration Utility – Increase number of threads to speed up data import


Sachin Bansal's avatarBansal Blogs - Dynamics 365, PowerApps, Microsoft Flows, Power BI

Configuration migration utility is part of Dynamics 365 SDK and located in SDKToolsConfigurationMigration folder. Tool is used to import configuration/master data across CRM organizations. By default tool runs with 5 threads to import data and data import is comparatively slow.

C1

You can increase number of threads to import data faster. Open DataMigrationUtility.exe.config file located in same folder SDKToolsConfigurationMigration. Search for “numberofinputthreads” and change value from 5 to 20 or more based on requirement. Once updated tool will initialize 20 threads and data will be imported comparatively faster.

C2

View original post

“Cannot delete an active workflow definition” error while importing solution in Dynamics 365


Recently while trying to import a solution (managed) to one of our test environments we got the below error.

import

The reason being one of the SLA(s) that was part of the solution was in Active stage in the test environment to which solution was getting imported.

Deactivating the SLA and then importing the solution again worked properly.

Hope it helps..

Dynamics 365 CRM Duplicate detection error : Generic SQL error.[Microsoft.Crm.DuplicateDetection: Microsoft.Crm.HasDuplicatesPlugin]


Prashant Maurya's avatarPrashant Kumar Maurya

Today we were facing a weird issue with one of CRM user. User was getting below error on create/update of Lead record.

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Generic SQL error.Detail:
<OrganizationServiceFault xmlns:i=”http://www.w3.org/2001/XMLSchema-instance” xmlns=”http://schemas.microsoft.com/xrm/2011/Contracts”>
<ActivityId>68953102-d03e-4a6e-9da4-98695fddff4e</ActivityId>
<ErrorCode>-2147204784</ErrorCode>
<ErrorDetails xmlns:d2p1=”http://schemas.datacontract.org/2004/07/System.Collections.Generic” />
<Message>Generic SQL error.</Message>
<Timestamp>2018-03-25T09:32:10.3819266Z</Timestamp>
<ExceptionRetriable>false</ExceptionRetriable>
<ExceptionSource i:nil=”true” />
<InnerFault i:nil=”true” />
<OriginalException i:nil=”true” />
<TraceText>

[Microsoft.Crm.DuplicateDetection: Microsoft.Crm.HasDuplicatesPlugin]
[cacdbb1b-ea3e-db11-86a7-000a3a5473e8: HasDuplicatesPlugin]

</TraceText>
</OrganizationServiceFault>

1 – We unpublished all duplicate detection rules on lead entity but no luck.

2 – Then we unpublished duplicate detection rule for all entity in the organization still same issue,

3 – Then we tried various combination of publish and un-publish but issue was not resolve.

Seems like CRM was stuck in a state for this user where it was not able to recover from :(.

next thing we tried is to disable duplicate detection rule from duplicate detection settings and it worked :).

To disable…

View original post 32 more words

Configuration Migration Utility not migrating all the records in Dynamics 365


Recently while trying to move data for one of our entities, we saw that Configuration Migration Utility was only moving 7 records out of 11.

Even in the log, we couldn’t find any error message.

<<Drive>>:\Users\<<username>>\AppData\Roaming\Microsoft\Microsoft Dynamics® CRM Configuration Migration Utility

In fact, exporting and importing the records through excel was also only adding the 7 records.

The way we fixed this issue was by specifying the primary field of the entity as the fields to compare on update.

Running the import again this time imported all the records.

Hope it helps..

How to – Stop an Azure Web Job using WEBJOBS_STOPPED and WEBJOBS_DISABLE_SCHEDULE configuration settings


We had one triggered web job running every 5 minutes that would pull the data from SQL On Prem DB and create lead records in CRM.

During testing we wanted to stop the running web job.

To do go to Application Settings for the App Service. Add WEBJOB_STOPPED and WEBJOBS_DISABLE_SCHEDULE setting with value 1.


We’d see our web job stop running.



Another option is to kill the process itself

Open à

https://[appname].scm.azurewebsites.net/ProcessExplorer


Get all the details here


https://github.com/projectkudu/kudu/wiki/WebJobs

Hope it helps..


Advertisements