Debugging · Dynamics CRM · Dynamics CRM 2016 · Dynamics CRM Online · Plugins

CRM Online: Server Caching on Retrieve (Plugin)

Recently when I was writing a plugin, I encountered an interesting caching scenario. The plugin does two things, function_A and function_B. They both need to retrieve the same entity that is associated with the plugin target entity. Consider the following scenario: 1. function_A is always called. But function_B is only called when certain condition is… Continue reading CRM Online: Server Caching on Retrieve (Plugin)

Debugging · Dynamics CRM 2011 · Plugin

CRM 2011: Plugin Context Depth for Associate One to Many (1:M) Relationship

Scenario: Entity X has one to many relationship with Entity Y. So in entity Y there is a lookup field new_xId. Users can edit Y record to assign new_xId or add Y from X subgrid. In this case because field new_xId always get changed, we added a plugin to update message of entity Y. We… Continue reading CRM 2011: Plugin Context Depth for Associate One to Many (1:M) Relationship

Debugging · Dynamics CRM 2011 · Dynamics CRM 4.0 · Plugin · Workaround

Plugin does not run during Data Import

Encountered this issue today, data is imported, but Plugin did not run for any of the records. The Plugin runs when creating record using CRM UI or SDK Call. Well, the cause is that if you check for context.Depth in your plugin code, the Async job that executes the import will cause the depth at… Continue reading Plugin does not run during Data Import

Dynamics CRM 2011 · Plugin · Workaround

CRM 2011: Filtering Attributes (Plugin) and Early Bound Code

Setting Filtering Attributes on Plugin Step is one of the things that is often overlooked. That is a shame because using Filtering Attributes can improve plugin performance significantly; and not to mention simplify execution order if you have complex chains of plugins. According to MSDN article here, Filtering Attributes is A list of entity attributes… Continue reading CRM 2011: Filtering Attributes (Plugin) and Early Bound Code

Dynamics CRM 2011 · Plugin

CRM 2011: Add/Remove Target Marketing List to Campaign Request/Message

On a recent project, we need to provide counts for the number of ‘targets’ for campaign. The theory in principle is simple, using plugin get all the target marketing list of a campaign and count the number of their members. For simplicity sake, only ‘static’ list is part of it. But of course the plugin… Continue reading CRM 2011: Add/Remove Target Marketing List to Campaign Request/Message

Debugging · Dynamics CRM 2011 · Plugin

CRM 2011: Plugin Playback (Offline Plugin Changes not synchronised)

I came across a very frustrating problem today regarding offline plugin playback where changes in offline plugin disappears when user goes online. I hope this will help others. Scenario 1. Pre-Event Update plugin which runs both online and offline. When online if context.IsOfflinePlayback is true, return. 2. Plugin will auto-populate another field. 3. User update… Continue reading CRM 2011: Plugin Playback (Offline Plugin Changes not synchronised)

Dynamics CRM 2011 · Plugin

CRM 2011: Plugins Partial Trust (Sandbox) vs Full Trust

Today I was asked a question, why should one register a plugin assembly as Sandbox? Well, the obvious answer is if one is registering the plugin to MSCRM Online or planning to migrate to MSCRM Online. Another thing is also that since it’s running in isolation mode, if things go wrong, code goes into eternal… Continue reading CRM 2011: Plugins Partial Trust (Sandbox) vs Full Trust

Dynamics CRM 2011 · Dynamics CRM 4.0 · Plugin

CRM 2011: Offline Plugin – Modifying Plugin to Support Offline Execution

This is a post following CRM 2011: Offline Plugin – Assembly Security Registry. In this post we are going to discuss about modifying plugin code to support offline execution. The important thing to remember here is that the plugin that is running both online and offline may execute twice. Please note the use of the word… Continue reading CRM 2011: Offline Plugin – Modifying Plugin to Support Offline Execution

Dynamics CRM 2011 · Plugin · Tools

CRM 2011: Offline Plugin – Assembly Security Registry

Registering CRM Plugin to run on Offline Client involves more than just ticking the Offline checkbox when registering Step on Plugin Registration Tool. Other things to consider are: 1. Assembly Security 2. Modifying your plugin code to support offline execution In this post, we will just look at the first item, Assembly Security. The reason… Continue reading CRM 2011: Offline Plugin – Assembly Security Registry

Debugging · Dynamics CRM 2011 · Plugin

CRM 2011: Changing Execution Order Causes Duplicate Plugin Step When Updating Managed Solution

I came across this issue yesterday when debugging the test environment for my current project. I decided to tidy up the execution order for the many plugins we have written on each entity. I then exported the managed solution from dev environment and updated the test environment. I found out that in test environment there… Continue reading CRM 2011: Changing Execution Order Causes Duplicate Plugin Step When Updating Managed Solution