tisdag 22 mars 2022

Solution import issue after 2022 Release wave 1

 

If you’re having issues importing solutions at the moment getting weird error messages like “Import failed: The evaluation of the current component(name=msdyn_knowledgemanagementsetting, id=33c540e8-76a5-ec11-983f-00224884c290) in the current operation (Delete) failed during managed property evaluation of condition: Managed Property Name: ismanaged; Component Name: msdyn_knowledgemanagementsetting” it might be an issue with the latest wave and the solution is not super straight forward.

I was trying to do an import yesterday and got this error and was mighty confused since I was sure there was no knowledge managing at all in the solution. The next thing I did was unzipping the solution and going through the xmls, that’s customizations.xml and solutions.xml, to see if there was a “msdyn_knowledgemanagementsetting” present in it, which there wasn’t.

Ok, next step was creating a support ticket. No next step is to ask on Facebook and I got a quick reply from the CRM group there where the response was “is the release wave installed in both systems?” and yes both environments have the latest release wave installed.

Now I created a support ticket and got a lightening speed response with “It’s a known issue, a patch is coming". The workaround is to set the knowledge management to enabled on the table that is causing the issue. In my case this was the product table so solution time!

 Unzip the solution and find the table tag in the customizations.xml looking like this: for <entity Name="Product">.

Under that row you should find this somewhere: <IsKnowledgeManagementEnabled> and change this: <IsKnowledgeManagementEnabled>0</IsKnowledgeManagementEnabled>
to this: <IsKnowledgeManagementEnabled>1</IsKnowledgeManagementEnabled>

 

Re-zip the solution and import, happy days.

This is a solution proposed by Microsoft support so it should be reliable, it worked for me so I thought I'd share it so you might not have to raise a ticket even if Microsoft support was mighty quick.

 

Rickard Norström
Developer at CRM-Konsulterna
www.crmkonsulterna.se  

 

tisdag 15 mars 2022

Count records in a table

 

It’s been a known issue since forever that you don’t know how many rows (records) there is in a table (entity) once the count is larger than 5000 since Microsoft in it’s infinite wisdom chose not to implement the counting of rows larger than 5000.

The usual solution from way back was to push the number of rows exported to Excel to half a million or so and then export the relevant records from advanced find and see how many rows were present in the excel file.

Jump to 2021, or maybe 2020 I’m not really sure. In the Webapi there is now a function that, supposedly, return the recordcount, note that it doesn’t return the number of rows.

https://docs.microsoft.com/en-us/dynamics365/customer-engagement/web-api/retrievetotalrecordcount?view=dynamics-ce-odata-9

That’s the docs page of this function and you pretty much do a call like “https://contosocrm.crm.dynamics.com/data/api/v9.1/RetrieveTotalRecordCount(EntityNames=['account'])” if you want to see the number of rows in the account table.

According to the documentation, this is supposed to give you the number of rows “from a snapshot within last 24 hours.”. This is maybe the only issue, but probably not. In quite a lot of cases I’ve seen the data is quite static but the return number if WAY off.

This is a shame, really, since the function is really nice to have and very practical since you don’t have to do something else like doing some magic in PowerBI, creating you own console app or using another tool like https://www.xrmtoolbox.com/plugins/Fic.XTB.FastRecordCounter/.

I wonder why the chosen implantation is set to work “on a snapshot from within last 24 hours” when you can use the xrmtoolbox tool to count the live data, or PowerBI even if will chew away at your entitled precious API calls. Too bad it isn’t implemented in a way that is usable for real.
I'm not even sure that the snapshot-part is the issue but I tested this on a customer system that's about to go live to see how the migration was going and the answer for account was 65k and when a colleague did the check using PowerBI the amount was 105k so I wonder what user scenarios this can be usable at all in.

 

Rickard Norström
Developer at CRM-Konsulterna
www.crmkonsulterna.se