Month: June 2018

Couldn’t import a Custom Control Default Config for ObjectTypeCode 10022 because its ‘customcontroldefaultconfigid’ already exists on the system.

Issue:

When doing Dynamic CRM OnPremise deployment, you might get above error. I am not sure of the actual root cause but there are few fixes that you can apply.

In my recent blog i have showed a fix for CustomControlDefaultConfig related error :  https://rawishblog.wordpress.com/2018/05/10/singleton-retrieve-query-should-not-return-more-than-1-record-manged-solution-import-error-onpremise/

 

Resolution:

For the above error where it talks about duplicate CustomControlDefaultConfig , you can use below method.

Use below query to find out the duplicates:

with lst as (
select CustomControlDefaultConfigId, count(*) cnt
from CustomControlDefaultConfig
group by CustomControlDefaultConfigId
having count(*) > 1
)
select ent.name, lst.CustomControlDefaultConfigId, cfg.CustomControlDefaultConfigIdUnique,   cfg.*
from lst
inner join CustomControlDefaultConfig cfg on cfg.CustomControlDefaultConfigId = lst.CustomControlDefaultConfigId
left join entity ent on ent.ObjectTypeCode = cfg.PrimaryEntityTypeCode

 

Once you have the duplicates , delete those records from this environment, export the solution again & finally try to import to other environment. Hopefully this will resolve the issue.

 

Cheers!

Count Total Subgrid Records in Dynamics CRM using JavaScript

In one of my previous blog I explained,how a rollup field can be used to count child records : Count the number of related child records using a Rollup field

However, Rollup field is calculated with an Async System Job, therefore, if you need something to be triggered on every form load; you will have to write a JS.

Here is a quick code to count the number of related sub-grid record on a form onload. You can put an alert of the count or add that number to a field.

function getTotalGridRecordCount() {
 debugger;
 try {

setTimeout(function () {
 if (Xrm.Page != null && Xrm.Page != undefined && Xrm.Page.getControl("contactopportunitiesgrid") != null && Xrm.Page.getControl("contactopportunitiesgrid") != undefined) {
 var count = Xrm.Page.getControl("contactopportunitiesgrid").getGrid().getTotalRecordCount();
 alert("Total Opportunities:"+count);

}
 }, 5000);
 }
 catch (e) {
 Xrm.Utility.alertDialog(functionName + "Error: " + e.message || e.description);
 }
}

Add script to the form and call this function on Onload event. Open the form to see it in action:

1

 

Hope this helps! cheers!

Enable “Read” Auditing In Dynamics CRM 365

Let’s agree, we all have been waiting for this feature since quiet long now.

Records “Read” Audit! yes you have heard it right. This feature will let you capture details about who is reading/retrieving the data just like create/update/delete etc.

This feature is available in Dynamics CRM 365 Online  v8 and above.

1

Note : The auditing logs will be available in the Office 365 Security & Compliance Center not in the tradition record audit history in CRM which actually makes sense as it will be gigantic data and shouldn’t be kept inside CRM.

Follow below steps on how to start utilizing this feature:

  1.  To enable auditing please follow below method:
    https://docs.microsoft.com/en-us/dynamics365/customer-engagement/admin/enable-use-comprehensive-auditing#enable-auditing-in-dynamics-365
  2. To see the logs , follow below :
    https://docs.microsoft.com/en-us/dynamics365/customer-engagement/admin/enable-use-comprehensive-auditing#review-your-audit-data-using-reports-in-office-365-security-and-compliance-center

I hope this helps!

Open Lookup Dialog Programmatically using Xrm.Utility–Dynamics V9.0

Thanks Debajit.

Debajit's Dynamic CRM Blog

This one feature that I am going to pen down here, personally I have longing for it quite sometime now.

So before going into the HOW part of it, let’s understand the why part of it? When do I need show a Lookup dialog Programmatically? Well the answer is, numerous occasions. Like if you need to throw up a lookup dialog on change of field on the form OR you needed to throw the lookup dialog on click of a button on a web-resource.

All this time, we have achieved this but not in a supported way. Probably we may have ended up using or some method of rnal namespace. But all these are unsupported and mere workaround to this perennial problem.

Well, no more messing around. Microsoft has finally brought in the

So let’s see how it works.

Let’s take a not so good example here. Let’s say whenever…

View original post 296 more words