Attach a static PDF to OOTB D365/CRM Workflow

So a recent requirement put to me was to send an email to customers with a specific attachment.

There was also a requirement to ensure the right people would get the email but that was fairly straight forward and manageable through Advance Find/Fetch XML.

I was quite keen to avoid development of a custom workflow activity or plugin to cater for this business objective.

After some investigating I found a fairly straight forward solution:

  1. Create an email template with the body/dynamic tags you wish to and attach the static attachment(in my case a PDF) here
  2. Create your asynchronous workflow as you normally would with the conditional logic and trigger points
  3. When adding the send email action, choose to use email template and call in the email template within the workflow

Simples :)!


Solution Import Error 0x80044150 – Object reference not set to an instance of an object.


While importing a solution I got a generic SQL error but when i downloaded the log file i saw below error:

import error1

0x80044150 – Object reference not set to an instance of an object 

I have seen this error in plugins several times but never in import but root cause and underlying issue remains the same.

The import was trying to find something which was not there in target.


There was a relationship in my solution exist as N:1 to an entity which was deleted from target system way back hence this error occurred. Using the relationship given in solution, CRM was trying to find related entity which wasn’t there.


Hope this helps.

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


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 :



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



Know When/Who Imported the Solution to Dynamics CRM

I get this question very often – “how do we know when and who imported the solution into CRM?”

Whilst there are so many method of knowing it for e.g looking into database or checking in the XML, there is tool which can be used. Available as a plugin for XRM tool box. It shows something like below:


Download the XRMToolBox from here : and extract to a folder. Run the application & follow below steps:

  1. from the main header options , click on tools> plugin store:
  2. on the next screen search for “Solution History” and select the plugin and click on “Install”:
  3. post this close this screenshot and open the tool from main xrmtoolbox navigatation.
    as soon as you open it – it will give you all the available solutions and as you select the solution it gives the information you need ( showed in the screenshot 1)


i hope this helps!