Beispiel #1
0
 public static void Go(XrmPlugin plugin)
 {
     try
     {
         plugin.GoExtention();
     }
     catch (InvalidPluginExecutionException ex)
     {
         //ADDED 10000 Limit To Trace As Was Receiving Buffer Exceeded Error
         //Couldn;t figure out where to increase buffer size
         plugin.Trace(ex.DisplayString().Left(10000));
         throw;
     }
     catch (Exception ex)
     {
         plugin.Trace(ex.DisplayString().Left(10000));
         throw new InvalidPluginExecutionException(ex.Message, ex);
     }
 }
Beispiel #2
0
        public void Execute(IServiceProvider serviceProvider)
        {
            string entityType;
            var    context        = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext));
            var    message        = context.MessageName;
            var    isRelationship = message == PluginMessage.Associate || message == PluginMessage.Disassociate;

            entityType = GetTypeSchemaName(context, isRelationship);



            var plugin = CreateEntityPlugin(entityType, isRelationship, serviceProvider);

            if (plugin != null)
            {
                plugin.ServiceProvider = serviceProvider;
                XrmPlugin.Go(plugin);
            }
        }