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 met.
2. function_A retrieve only certain fields of that same entity (for performance consideration).
3. function_B retrieve all fields of that same entity.

When function_B is actually called, the original result of query from function_A is returned. This means that other fields are returned as null even though there are values in the database.

I had always thought that CRM will cache if the query is exactly the same, but in this scenario, it shows that that may not be the case.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s