Solution With Id = 86ac16ec-41d7-4685-a330-0b1c31411260 Does Not Exist

In some rare scenario's you might get the error message "solution With Id = 86ac16ec-41d7-4685-a330-0b1c31411260 Does Not Exist" while deleting a solution. In our scenario this seems to happen after using the holding solution approach. Luckily this can be solved as long as you have access to the SQL database. Note: Direct SQL updates are unsupported, so only perform this action if you're aware of the risks.

The error appears due to some remaining AttributeMap records for virtual attributes. In more detail, when you create an attribute map between two entities for a lookup attribute, it not only creating an attribute map for the id of the entity, but also for the name of that particular lookup. So in case of an account mapping, it creates an attribute map for accountid as well as accountidname. After moving around with solutions, CRM occacionally forgets to update the owning solution id for the 'name' attribute mappings.

You can visualize the relevant attributes using the following query:

SELECT
 a.SolutionId,
 a.SourceAttributeName,
 a.TargetAttributeName,
 pa.SolutionId,
 pa.SourceAttributeName,
 pa.TargetAttributeName
FROM attributemapbase a
LEFT OUTER JOIN attributemapbase pa
 ON a.parentattributemapid=pa.attributemapid
WHERE a.solutionid='86ac16ec-41d7-4685-a330-0b1c31411260'

You'll see the virtual attributes with their parent attributes and the corresponding solutionid according to the attribute map. The mismatch between the solutionid of the attributemap and the solutionid of the parent attribute map is what causes the error while deleting the solution. Updating the solutionid will solve the issue for you. Here's the query to help you perform this action. Obviously you'll need to change the solutionid to the solutionid as presented to you when downloading the error log file:

UPDATE AttributeMapBase
 SET SolutionId = pa.solutionid
 FROM AttributeMapBase
LEFT OUTER JOIN AttributeMapBase AS pa
 ON AttributeMapBase.ParentAttributeMapId = pa.AttributeMapId
WHERE AttributeMapBase.SolutionId = '86ac16ec-41d7-4685-a330-0b1c31411260'

I'm sure Microsoft will fix this issue sooner or later, but for now I hope this post will help you anyway.


Update:
Apparently there are other scenario's when this error occurs as well. When you create a businessrule, then on the database a record will be created in the "WorkflowBase" will be created, as well as one or more records in the "ProcessTriggerBase". For some reason it is possible that the records in the ProcessTriggerBase are not updated to the new solution ID, resulting in an incorrect record. While deleting a managed solution the deletion process recorgnized the non existing SolutionID and causes the delete to stop.

The way to identify the business rule that is causing the issue, you can run the following query:

select ptb.ProcessId, wb.Name, ptb.solutionid, wb.solutionid
from
 
 
ProcessTriggerBase ptb
 
left join WorkflowBase wb on ptb.ProcessId = wb.WorkflowId
where
ptb.solutionid='86ac16ec-41d7-4685-a330-0b1c31411260'

You then can delete this business rule by hand using the advanced find (search for all processes with category=business rule). Once this rule is removed, then the solution can be uninstalled.



Processtrigger error messages and the holding solution approach

The holding solution approach, sometimes referred to as a shadow solution or the shared publisher technique, is the recommended approach for removing solution components from a CRM organization. Generally this works ok, however we have been facing some challenges lately. Some errors that you might encounter:

- Crm Exception: Message: processtrigger With Id = 3922b595-8637-e511-80d3-b13ac3e6ed07 Does Not Exist, ErrorCode: -2147220969

- 0x80040203 Could not retrieve parent object id for label with id 1f26a158-cf40-e511-80d6-f0b8a7508109 and label type code 19

- Cannot find a top solution for ProcessTrigger:3922b595-8637-e511-80d3-b13ac3e6ed07

My analysis has shown that there is a challenge with Business Rules when using the holding solution approach. The option that I found to get this working is to temporarily remove the business rules from the holding solution. Here's how you can get this to work on a supported approach:

- Export solution as managed
- Export solution as unmanaged
- Remove troubling business rules [1]
- Export the solution as managedHolding
- Import the unmanaged solution in your dev environment.

For the unsupported approach, but just as effective,
- Copy the managed solution to a temporary managed solution
- Export solution.xml & customizations.xml from the managed solution
- Modify the unique name & save the solution.xml
- Remove the troubling business rules in the customizations.xml
- Replace the solution.xml & customizations.xml in the temporary managed solution
- In the zip file, remove the business rules from the workflows folder

You now have a managed solution export which does have the business rules, but a managedHolding solution which doesn't have the business rules. Make sure to change the unique name of the solution and you're set to go. In your target environment:

- Import the managedHolding solution
- Remove the previous solution
- Import the managed solution
- Remove the managedHolding solution

And that should do the trick! Now let's hope that this will be fixed soon.

[1] To find out which business rule is the cause of the problems, copy and paste the processtriggerid into the following query and run this on your database. For CRM online it'll be a bit more challenging to find out which business rule is causing the issue.

select
processid, (select workflow.Name from workflow where workflow.WorkflowId = ptb.processid),
solutionid, (select FriendlyName from solution where solutionid= ptb.solutionid),
ptb.overwritetime
from
ProcessTriggerBase ptb
where
ProcessTriggerId = '3922b595-8637-e511-80d3-b13ac3e6ed07'

Alternatively, you could create a temporary holding solution (managed) by:
- copying the original
- modify the solution unique name
- remove the business rule(s) from the customizations file

For more information about the technique, have a look at Microsoft's document: ALM for Microsoft Dynamics CRM 2011: CRM Solution Lifecycle Management.



Retrieve CSV file uploaded to CRM standard import

In some rare cases you wish you could retrieve the file uploaded to CRM. Unfortunately, there is no way that CRM is going to return you this file...

But luckily, in OnPremise and some Partner Hosted environments, it is possible to access the underlying database. This is where you can find the data for each of the rows which allow you to recreate the CSV (or XML) file.

The following query will retrieve all the relevant information:

SELECT ifb.ImportFileId,
    Source,
    HeaderRow,
    Data,
    LineNumber
   
  FROM ImportDataBase idb
  LEFT OUTER JOIN ImportFileBase ifb ON idb.ImportFileId = ifb.ImportFileId
  WHERE ifb.ImportFileId = 'DEAC184E-D7CA-E311-B83A-00155D083043'
  ORDER BY Source, LineNumber


Of course you'll need to change the importfileid GUID or change this to select based on the source (the name of the imported file). Then Copy the header row, followed by each of the data rows and your source file is recreated.

Good luck!



Restore removed sitemap entries

In Dynamics CRM you can work with solutions that stack on top of other solutions. This does require some careful planning and consideration during development as a change in one organization impacts other organizations. One of these changes are changes to the sitemap. If you add a sitemap entry in one solution and remove this in the second, then in a 3rd organization this entry will not be visible. However, how do you restore this entry?

CRM will place the following actions in the sitemap node of the customizations file when you export this as a managed solution. For the first solution where you add the sitemap entry:
<SubArea Entity="cht_yourentity" Id="cht_yourentity" AvailableOffline="false" PassParams="false" ordinalvalue="0" />

In the export for the second solution where you remove the sitemap entry:
<
SubArea Entity="cht_yourentity" Id="cht_yourentity" AvailableOffline="false" PassParams="false" ordinalvalue="0" solutionaction="Removed" />

As you can see, the solutionaction is removed. So, how can you remove this solution action?

Dynamics CRM is generating the actions based on the current state of the sitemap compared to the other existing (managed) solutions. This means that if you add a new sitemap entry in the second solution, then this will not be recognized as a difference and hence the solutionaction will be removed.

In short, just add a new sitemap navigation entry and this will solve your problem.

Cheers!       



Dynamics CRM instruction video's in Dutch!

Just recently Microsoft has started to provide instruction video's not only in English, but also in other languages. And, one of these foreign languages is Dutch!

You can find the first video's on Youtube's channel "Microsoft Dynamics CRM Product Information Dutch"

The currently available video's are:
- Aan de slag met Microsoft Dynamics CRM 
- Nieuwe navigatie voor Microsoft Dynamics CRM Online 
- Microsoft Dynamics CRM voorjaar 2014 - Wachtrijverbeteringen 
- Microsoft Dynamics CRM voorjaar 2014 - Overzicht van servicebeheer 
- Snelle tips voor CRM voor tablets 
- Snelle tip voor CRM 2013: snel toegang tot klantgegevens in Microsoft Dynamics CRM 
- Snelle tip voor CRM 2013: voeg snel nieuwe informatie toe via snelkoppelingen 




Change the AggregateQueryRecordLimit for 1 organization

In CRM there are a couple of thresholds created to guarantee performance of the application. Though this is a good thing, it does cause some issues every now and then. One of these thresholds is the AggregateQueryRecordLimit.

You will find that CRM uses this threshold as soon as you want to view a chart or execute an aggregation in a report over more than 50.000 records. If this is the case, then CRM will present you with the error message "AggregateQueryRecordLimit exceeded. Cannot perform this operation.".

Multiple guys have posted about changing this setting (hint:
update DeploymentProperties set IntColumn = 250000 where ColumnName = ‘AggregateQueryRecordLimit’), but this allows every organization in your instance to exceed this threshold, while you might only want to allow one organization to do this.

Though it is not documented in the SDK, it is possible to set this value for just a single organization. Just as easy as updating the deploymentproperties table, you can also add a record to the organizationproperties table (in the MSCRM_CONFIG database):

INSERT INTO MSCRM_CONFIG.dbo.OrganizationProperties (Id, ColumnName, IntColumn)
VALUES ('8CB2768E-1585-E411-80BC-D4490D33C5AC', N'AggregateQueryRecordLimit', 250000)


Obviously you'll need to replace the guid with the ID of your organization (select id, FriendlyName from Organization) and the number in the end with the amount of records you would allow to be aggregated.

Enjoy!



Create icons for Dynamics CRM 2013/2015/Online

Back in the days of Dynamics CRM 2011 full color icons were the default, but now Microsoft has changed the look and feel. This new user interface of Dynamics CRM does require you to rethink how to work with icons. The larger icons appear to be blueish and white when you hover over them, while the smaller icons are grayish.

The guys at Magnetism have done a great job describing where these icons are displayed, however it would also be useful to have some guidance on how to create these new icons. You can of course go back to a designer and have this done for you, but there are some easy tricks to get existing icons updated or redesign any of the free resources to match the new UI.

First of all, it's good to know that the icons in the menu bar which appear as light blue, aren't actually blue. The icons are white (RGB: FFFFFF), but CRM renders them in light blue until the user hovers over. This means that while developing your 32x32 pixel images, you can make them white. An easy and cheap approach to do this, is to use paint.net.

Within paint.net, you can open the image:

 Then go to "Adjustments" -> "Curves":

Drag the dot from the left top to the right top. You'll see the code change from (0, 255) to (255,255):

And your image appears in white.

The smaller images, only used for entities, the color is in gray shades. You can either use the same approach as above to transform the image to gray, but an even easier approach is to use the black & white option:


After saving your images, then you can upload them to CRM as a web resource and start using them in the sitemap or as entity icons.



Multiple CRM servers, ADFS and the pesky "An error occured"

If you have multiple Dynamics CRM 2011 machines configured to use the same ADFS server, then you will probably run into this error message:

An error occured:
Try this action again. If the problem continues, check the Microsoft Dynamics CRM Community for solutions or contact your organization’s Microsoft Dynamics CRM Administrator. Finally, you can contact Microsoft Support.

In the URL you can find more details about the error message, which will lead you to this error message:

A CryptographicException occurred when attempting to decrypt the cookie using the ProtectedData API (see inner exception for details).  If you are using IIS 7.5, this could be due to the loadUserProfile setting on the Application Pool being set to false.

This has to do with the fact that your first CRM server is providing a cookie to the user which is being reused to authenticate against the second CRM server. This doesn't match, resulting in the error above.

The same scenario exists for a load balancer where you have multiple CRM servers which access the same CRM database. This led me to the blog of Dan Brunn, which describes how to get past this for an NLB environment:
- Open the CRM Deployment Manager - Microsoft Dynamics CRM Properties - Web Address tab - Advanced
- Check the ‘The deployment uses an NLB’
- Run IISRESET
- Re-test

After testing this approach, we found that this also works for the scenario where you have multiple CRM servers behind the same ADFS server.

Forum posts have indicated that not everybody is having the same amount of luck with this approach. I would recommend to follow the ADFS best practises from Chris Cognetta to double check the ADFS settings.



Find out deployment administrators

When starting the deployment manager (start -> programs -> microsoft dynamics crm ->deployment manager) you might get the bugged with a message when you're not the deployment administrator of the machine. This even happens when you're domain admin, sys admin on the database and/or local admin on the machine:

"Only the Deployment Administrators are able to use the deployment manager"

The only way to start the deployment manager, is when you're a deployment administrator. And guess what, the only place to add you as a deployment administrator is within the deployment manager tool. Catch 22? Not really, because the person who installed Dynamics CRM is added as a deployment administrator automatically. However, if you have no clue who this is, then you can get this information from SQL server.

The following query will provide you with a list of all the deployment administrators of your environment:
SELECT Name, IsDisabled, Name, IsDeleted FROM [MSCRM_CONFIG].[dbo].[SystemUser]
WHERE DefaultOrganizationId ='00000000-0000-0000-0000-000000000000'

How to find out which SQL server is used by CRM? You won't believe it, you can get this information from the servers tab in the deployment manager* ;)

*or windows register: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSCRM



Restore missing user in MSCRM_CONFIG

In some rare scenario's you'll not be able to login to CRM though you are sure that you're use has been added to the organization and you have a security role as well. The pesky error message generally is:

404 - File or directory not found.
The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.

If this is the case, then it could be that your user is missing in the MSCRM_CONFIG database. Especially if you're moving around database with backup and restore, then this could happen. If you think this could be the case in your scenario, then make sure to start a SQL profiler and grab the entry that shows up when refreshing the page. It would like like this:

exec sp_executesql N'exec p_GetCrmUserId @OrganizationId, @AuthInfo',N'@OrganizationId uniqueidentifier,@AuthInfo nvarchar(46)',@OrganizationId='0474D466-1234-E311-1234-A02B3F591536',@AuthInfo=N'W:S-1-5-21-123456789-1234567890-123456789-1234'

When executing that query against the MSCRM_CONFIG you should not get any result. If this is indeed the case, then you can add your user back into this table with the query below. The usual statements apply, backup first, unsupported and only execute this when you know what you're doing.

USE [MSCRM_CONFIG]
GOINSERT INTO [dbo].[SystemUserOrganizations]
([CrmUserId]
,[Id]
,[OrganizationId]
,[UserId]
,[IsDeleted]
)
VALUES
((select systemuserid from [2011FR2_MSCRM].dbo.SystemUserBase where DomainName='[domain]\[username]')
,NEWID()
,(select id from organization where DatabaseName = '[ORG]_MSCRM')
,(select userid from SystemUserAuthentication where authinfo='[Auth info as copied from the SQL profiler')
,0
)
GO
 



Find missing dependencies when deleting a solution

When deleting a solution in Dynamics CRM, the system checks for dependencies first. If any of the dependencies still exist, then the delete operation will be aborted and the user will receive an error message:

Connot Delete Component (Cannot delete Main because one or more components require it."

The only option for more info, is the Download Log File, but this doesn't tell you really what happened either:

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: The Main() component cannot be deleted because it is referenced by 1 other components. For a list of referenced components, use the RetrieveDependenciesForDeleteRequest.Detail:
<OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
<ErrorCode>-2147160033</ErrorCode> <ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic">
<KeyValuePairOfstringanyType><d2p1:key>0</d2p1:key><d2p1:value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">Main</d2p1:value></KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType><d2p1:key>1</d2p1:key><d2p1:value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string"></d2p1:value></KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType><d2p1:key>2</d2p1:key><d2p1:value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">1</d2p1:value></KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType><d2p1:key>3</d2p1:key><d2p1:value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">Solution</d2p1:value></KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<d2p1:key>4</d2p1:key>
<d2p1:value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string"><a id='a_helplink' tabindex='0' class='ms-crm-Dialog-Error-Link' onclick='openStdWin("\x2ftools\x2fdependency\x2fdependencyviewdialog.aspx\x3fobjectid\x3d\x257b703af1df-aafb-4c61-b97f-da639fbe8d27\x257d\x26objecttype\x3d7100\x26operationtype\x3ddependenciesforuninstall", null, 800, 600, null)'>Details</a></d2p1:value>
</KeyValuePairOfstringanyType>
</ErrorDetails>
<Message>The Main() component cannot be deleted because it is referenced by 1 other components. For a list of referenced components, use the RetrieveDependenciesForDeleteRequest.</Message>
<Timestamp>2015-02-12T12:24:36.2628436Z</Timestamp>
<InnerFault i:nil="true" />
<TraceText i:nil="true" />
</OrganizationServiceFault>

However, there seems to be a little bit of useful info in there. This is the section "\x2ftools\x2fdependency\x2fdependencyviewdialog.aspx\x3fobjectid\x3d\x257b703af1df-aafb-4c61-b97f-da639fbe8d27\x257d\x26objecttype\x3d7100\x26operationtype\x3ddependenciesforuninstall". When replacing some chracters ("\x2f" to "/", "\x3" to "?", "\x3d" to "=", "\x26" to "&", "\x257b" to "{" and "\x257d" to "}"), then you're presented with the url: /tools/dependency/dependencyviewdialog.aspx?objectid={703af1df-aafb-4c61-b97f-da639fbe8d27}&objecttype=7100&operationtype=dependenciesforuninstall. Add "http://[yourserver] to the beginning and you've got your url that'll tell you exactly what dependencies to remove before you can remove the (managed) solution.

A shorter approach, but just as effective would be to take this url and change yourserver and the solution guid:

http://yourserver/tools/dependency/dependencyviewdialog.aspx?objectid={solutionguid}&objecttype=7100&operationtype=dependenciesforuninstall

Your solution guid can be found by opening the solution and pressing F11 or CTRL+N to see the url. In the url take the section between %7b and %7d: https://[yourserver]/tools/solution/edit.aspx?id=%7bC418E1D5-9AFB-E311-90E1-00155D042F50%7d) and you're set to go!



CRM Outlook Client 2011 on a Windows Server 2012?

In some scenario's you might want to install the CRM Outlook Connector for Microsoft Dynamics CRM 2011 on a server which is newer than the Implementation Guide mentions as supported operating systems.
When trying to do so, you'll quickly find yourself facing the following scenario:




The error message is:
The installation has failed. The computer is running an operating system that Microsoft Dynamics CRM does not support. To install this product, you must upgrade your computer to a supported operating system.

Interesting, because you actually need to degrade your computer. However, the next trick will allow you to install the Outlook client after all. Use the properties on the setup file and let Windows figure out the compatibility mode and 'test' the program. This will allow the setup to run and install the add-in.

Please note that I don't recommend this approach as Microsoft may make any update in the future which causes the Outlook Client to have issues.

Here's the process in screenshots:
















Note: when the install doesn't want to pass the Windows Update, then have a look if there's a popup open somewhere started by the Windows Update. This could be an update rollup or any other update that needs your attention as well.

Good luck!



.NET Framework 3.5 install on a Windows 2012 machine

For some applications it's required to have .NET Framework 3.5 installed on your Windows 2012 machine. Some of these applications include SQL 2014 and CRM 2015.

The ususal option is to select the ".NET Framework 3.5 Features" in the "Add Roles and Features Wizard" of the windows server manager. However, in some scenario's this leads to the following error message:

Installation of one or more roles, role services, or features failed.
The source files could not be found. Try installing the roles, role services, or features again in a new Add Roles and Features Wizard session, and on the Confirmation page of the wizard, click "Specify an alternate source path" to specify a valid location of the source files that are required for the installation. The location must be accessible by the computer account of the destination server.

Now if you have the windows 2012 disc at hand, you can follow the next statement.
DISM /Online /Enable-Feature /FeatureName:NetFx3 /All /LimitAccess /Source:d:\sources\sxs
If you don't have the windows 2012 disc at hand, you can force the installer to grab .NET Framework 3.5 from the Windows Update. You can do that using the following statement in the command prompt:
DISM /Online /Enable-Feature /FeatureName:NetFx3 /All

For more details see Technet: https://technet.microsoft.com/en-us/library/hh831809.aspx#BKMK_dism



Error while updating FieldSecurityProfiles


Error Number: 0x8004F502
Error Message: Caller 922a732c-0e44-e411-80bf-aecaab867a05 doesn't have Create privilege for attribute 'new_attribute' of entity 'contact'

Tip: Check if the attribute on the form is read-only, this can cause the error message, even though the user is System Administrator.