locked
CRM 2013 Online plugin clear entity cache RRS feed

  • Question

  • Hi,

    I am working on a CRM 2013 Online plugin, registered as Retrieve for account, Post operation. It seems that it caches entity.id. When I load different Account, it runs on the same entity.id.  How would I clear the entity cache, before I load another account?  Thanks.

    Wednesday, January 14, 2015 4:54 AM

All replies

  • Hello,

    I don't think that it is how you've described it. Please provide code you use and registration parameters of your plugin.


    Dynamics CRM MVP/ Technical Evangelist at SlickData LLC
    My blog

    Wednesday, January 14, 2015 5:24 AM
    Moderator
  • Hi, Andrii

    Thanks for your quick response.  I registered the plugin in Sandbox isolation mode, Retrieve message, Post operation and Synchronous process:

    public void Execute(IServiceProvider serviceProvider)
            {

                ITracingService tracingService =
                    (ITracingService)serviceProvider.GetService(typeof(ITracingService));

                IPluginExecutionContext context = (IPluginExecutionContext)
                    serviceProvider.GetService(typeof(IPluginExecutionContext));

                if (context.InputParameters.Contains("Target") &&
                    context.InputParameters["Target"] is Entity)
                {

                    Entity entity = (Entity)context.InputParameters["Target"];

                    if (entity.LogicalName != "account")
                        return;

    ..................................

    Wednesday, January 14, 2015 1:04 PM
  • Hi,

    It may not be an cache issue.  It may just Retrieve does not update customized attribute.  I use service.update(acct); in my code.

    Wednesday, January 14, 2015 4:00 PM