Display Rule Still Exist After Removing It

Have you ever faced an issue where you made changes to a customization in Dynamics 365 CRM/Power Platform? For example, you added a display rule to a ribbon button and deployed the changes to the target environment using a managed patch.

Later, the client changed their mind, so you removed the rule and deployed an updated patch. But surprisingly, the old rule was still there!

If you’ve faced this issue, you’re in the right place. In this blog, I’ll explain why this happens and how to resolved it.

Why Did This Happen?

This issue is specifically related to solution patching in Dynamics 365 CRM. It can occur whenever you add a customization through a patch and later decide to remove it.

To understand why this happens, we first need to understand how patches work.

According to the Microsoft documentation:

“A patch represents an incremental minor update to the parent solution. A patch can add or update components and assets in the parent solution when installed on the target system, but it can’t delete any components or assets from the parent solution.”

In simple terms, a patch is used to deliver incremental changes to an existing solution. It can add new components or update existing ones, but it cannot delete components from the parent solution.

For example, suppose you added a display rule to a ribbon button and deployed it to the target environment using a managed patch. Later, you removed that display rule from the source customization and deployed another patch.

You might expect the display rule to be removed from the target environment as well. However, this will not happen just by removing the rule from the source and deploying an updated patch.

The reason is that the updated patch does not include instructions to delete the previously deployed customization. As a result, the old display rule can remain in the target environment, even though it is no longer present in the customization XML of your updated patch.

Now that we understand why this happens, let’s look at how to resolve it.

How to Solve This Issue

To remove the previously deployed changes from the target environment, you need to deploy an updated solution using the appropriate solution upgrade process rather than relying on another patch.

Instead of selecting Clone a Patch, use the Clone Solution option in your development environment.

When you clone the base solution, all its child patches are rolled up into the base solution, creating a new solution version. Unlike a patch, a cloned solution allows you to add, update, and delete components and assets.

When you deploy the cloned solution as a managed solution to the target environment, it acts as a replacement for the previous version of the solution. This allows you to deliver major updates, including the removal of components or customizations that are no longer required.

Summary

Use patches for incremental changes, but when you need to remove previously deployed customizations, consider cloning the base solution and deploying it through the appropriate upgrade process.

Hope it will help someone!!
Keep learning and Keep Sharing!!

Leave a Reply

Your email address will not be published. Required fields are marked *

Are you human? Please solve:Captcha