Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

IPlugin keeps returning error System.ArgumentNullException: Value cannot be null (infinite loop).

Posted on by Microsoft Employee

Recently I created a Plugin for my Dynamics Online which updates the freightamount of a quote when a custom field changes value. 

The custom field (frequency) is created on the quote entity and the freightamount is calculation is based upon the extendedamount values of the quotedetail records, the calculation is simple a multiplication of the extendedamounts with the frequency. This is being done to abuse the freightamount as an extra parameter to calculate the quote amount.

When testing the Plugin it all seem to work fine up to the last bit which actually updates the freightamount. The error being returned is:

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Unexpected exception from plug-in (Execute): MyPlugin.MyPluginClass: System.ArgumentNullException: Value cannot be null.


This error is returned several times with eventually returning the following error:

Parameter name: Microsoft.Xrm.Sdk.InvalidPluginExecutionException: An error occurred in the MyPlugin plug-in. ---> System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]: This workflow job was canceled because the workflow that started it included an infinite loop. Correct the workflow logic and try again. For information about workflow logic, see Help.


After reading up I understand that something is triggering my Plugin to loop indefinitely. Though, I cant seem to figure out how/why this Plugin event is triggered so many times (if this is really the case)? 

My Plugin code looks as follow:

public class FrequentieBerekening : IPlugin
    {
        public void Execute(IServiceProvider serviceProvider)
        {
            // Obtain the execution context from the service provider
            IPluginExecutionContext context = (IPluginExecutionContext)
                serviceProvider.GetService(typeof(IPluginExecutionContext));


            // Get a reference to the Organization service.
            IOrganizationServiceFactory factory =
                (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));
            IOrganizationService service = factory.CreateOrganizationService(context.UserId);

            if (context.InputParameters != null)
            {
                if (context.InputParameters.Contains("Target") && context.InputParameters["Target"] is Entity)
                {
                    // Obtain the target entity from the input parameters.
                    Entity entity = (Entity)context.InputParameters["Target"];
                  
                    try
                    {
                        
                        // Execute the right method depending on the target entity
                        switch (entity.LogicalName)
                        {
                            case "quote":
                                CalculateQuote(entity, service);
                                return;

                            default:
                                return;
                        }
                    }
                    catch (FaultException<OrganizationServiceFault> ex)
                    {
                        throw new InvalidPluginExecutionException("An error occurred in the MyPLugin plug-in.", ex);
                    }

                    catch (Exception ex)
                    {
                        throw new ArgumentNullException(ex.ToString());
                    }
                }
            }
        }



        private static void CalculateQuote(Entity entity, IOrganizationService service)
        {
            
            // Get quote fields
            ColumnSet columns = new ColumnSet() { AllColumns = true };
            Entity quote = service.Retrieve(entity.LogicalName, entity.Id, columns);

            decimal frequency = 1; // Default 1

            if (quote.Contains("new_frequency"))
            {
                if ((decimal)quote["new_frequency"] > 1)
                {
                    frequency = (decimal)quote["new_frequency"];
                }
            }


            // Get data from reletated quotedetail which are needed for the calculation - ony for several products
            QueryExpression query = new QueryExpression("quotedetail")
            {
                ColumnSet = new ColumnSet() { AllColumns = true },
                LinkEntities =
                    {
                        new LinkEntity
                        {
                            Columns = new ColumnSet { AllColumns = true },
                            JoinOperator = JoinOperator.Inner,
                            LinkFromAttributeName = "productid",
                            LinkFromEntityName = "quotedetail",
                            LinkToAttributeName = "productid",
                            LinkToEntityName = "product",
                            EntityAlias = "product"
                        }
                    },
                Criteria =
                    {
                        Filters =
                        {
                            new FilterExpression
                            {
                                FilterOperator = LogicalOperator.And,
                                Conditions =
                                {
                                    new ConditionExpression("quoteid", ConditionOperator.Equal, entity.Id)
                                },
                            }

                        }
                    }
            };

            EntityCollection quotedetail_records = service.RetrieveMultiple(query);

            decimal totalAmount_product_A = 0;
            decimal totalAmount_product_B = 0;
            decimal totalAmount_product_C = 0;
            decimal totalAmount_product_D = 0;
            decimal total_amount_quote = 0;
            Money total_freightamount = new Money(0);

            // Loop through the products
            for (int i = 0; i < quotedetail_records.Entities.Count; i++)
            {
                if ((string)quotedetail_records.Entities[i].GetAttributeValue<AliasedValue>("product.name").Value == "Product A")
                {
                    totalAmount_product_A += ((Money)quotedetail_records.Entities[i]["extendedamount"]).Value * frequency;
                }

                if ((string)quotedetail_records.Entities[i].GetAttributeValue<AliasedValue>("product.name").Value == "Product B")
                {
                    totalAmount_product_B += ((Money)quotedetail_records.Entities[i]["extendedamount"]).Value * frequency;
                }

                if ((string)quotedetail_records.Entities[i].GetAttributeValue<AliasedValue>("product.name").Value == "Product C")
                {
                    totalAmount_product_C += ((Money)quotedetail_records.Entities[i]["extendedamount"]).Value; //Dont multiply with the frequency
                }
				
				if ((string)quotedetail_records.Entities[i].GetAttributeValue<AliasedValue>("product.name").Value == "Product D")
                {
                    totalAmount_product_D += ((Money)quotedetail_records.Entities[i]["extendedamount"]).Value * frequency;
                }
            }

            
            // Look what the total amount of 'frequency' is
            if (quote.Contains("totalamount"))
            {
                total_amount_quote = ((Money)quote["totalamount"]).Value;
                var total = totalAmount_product_A + totalAmount_product_B + totalAmount_product_D + totalAmount_product_C;

                total_freightamount = new Money(total - total_amount_quote);
            }

   
            // Update the freightamount
            quote["freightamount"] = total_freightamount;

            try
            {
                service.Update(quote);
            }
            catch (FaultException<OrganizationServiceFault> ex)
            {
                throw new InvalidPluginExecutionException("An error occurred in the GWS plug-in.", ex);
            }

            catch (Exception ex)
            {
                throw new ArgumentNullException(ex.ToString());
            }

            return;

        }


Anyone has a clue where I am causing the infinite loop? I also checked my custom workflows and I can't see anything the triggers on the frequency. 

The Assembly / Step is registered as follows:

3036.Capture1.PNG

2022.Capture2.PNG

The full error log:

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Unexpected exception from plug-in (Execute): GWSPlugins.FrequentieBerekening: System.ArgumentNullException: Value cannot be null.
Parameter name: Microsoft.Xrm.Sdk.InvalidPluginExecutionException: An error occurred in the GWS plug-in. ---> System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]: Unexpected exception from plug-in (Execute): GWSPlugins.FrequentieBerekening: System.ArgumentNullException: Value cannot be null.
Parameter name: Microsoft.Xrm.Sdk.InvalidPluginExecutionException: An error occurred in the GWS plug-in. ---> System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]: Unexpected exception from plug-in (Execute): GWSPlugins.FrequentieBerekening: System.ArgumentNullException: Value cannot be null.
Parameter name: Microsoft.Xrm.Sdk.InvalidPluginExecutionException: An error occurred in the GWS plug-in. ---> System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]: Unexpected exception from plug-in (Execute): GWSPlugins.FrequentieBerekening: System.ArgumentNullException: Value cannot be null.
Parameter name: Microsoft.Xrm.Sdk.InvalidPluginExecutionException: An error occurred in the GWS plug-in. ---> System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]: Unexpected exception from plug-in (Execute): GWSPlugins.FrequentieBerekening: System.ArgumentNullException: Value cannot be null.
Parameter name: Microsoft.Xrm.Sdk.InvalidPluginExecutionException: An error occurred in the GWS plug-in. ---> System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]: Unexpected exception from plug-in (Execute): GWSPlugins.FrequentieBerekening: System.ArgumentNullException: Value cannot be null.
Parameter name: Microsoft.Xrm.Sdk.InvalidPluginExecutionException: An error occurred in the GWS plug-in. ---> System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]: Unexpected exception from plug-in (Execute): GWSPlugins.FrequentieBerekening: System.ArgumentNullException: Value cannot be null.
Parameter name: Microsoft.Xrm.Sdk.InvalidPluginExecutionException: An error occurred in the GWS plug-in. ---> System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]: Unexpected exception from plug-in (Execute): GWSPlugins.FrequentieBerekening: System.ArgumentNullException: Value cannot be null.
Parameter name: Microsoft.Xrm.Sdk.InvalidPluginExecutionException: An error occurred in the GWS plug-in. ---> System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]: Unexpected exception from plug-in (Execute): GWSPlugins.FrequentieBerekening: System.ArgumentNullException: Value cannot be null.
Parameter name: Microsoft.Xrm.Sdk.InvalidPluginExecutionException: An error occurred in the GWS plug-in. ---> System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]: Unexpected exception from plug-in (Execute): GWSPlugins.FrequentieBerekening: System.ArgumentNullException: Value cannot be null.
Parameter name: Microsoft.Xrm.Sdk.InvalidPluginExecutionException: An error occurred in the GWS plug-in. ---> System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]: Unexpected exception from plug-in (Execute): GWSPlugins.FrequentieBerekening: System.ArgumentNullException: Value cannot be null.
Parameter name: Microsoft.Xrm.Sdk.InvalidPluginExecutionException: An error occurred in the GWS plug-in. ---> System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]: Unexpected exception from plug-in (Execute): GWSPlugins.FrequentieBerekening: System.ArgumentNullException: Value cannot be null.
Parameter name: Microsoft.Xrm.Sdk.InvalidPluginExecutionException: An error occurred in the GWS plug-in. ---> System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]: Unexpected exception from plug-in (Execute): GWSPlugins.FrequentieBerekening: System.ArgumentNullException: Value cannot be null.
Parameter name: Microsoft.Xrm.Sdk.InvalidPluginExecutionException: An error occurred in the GWS plug-in. ---> System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]: Unexpected exception from plug-in (Execute): GWSPlugins.FrequentieBerekening: System.ArgumentNullException: Value cannot be null.
Parameter name: Microsoft.Xrm.Sdk.InvalidPluginExecutionException: An error occurred in the GWS plug-in. ---> System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]: Unexpected exception from plug-in (Execute): GWSPlugins.FrequentieBerekening: System.ArgumentNullException: Value cannot be null.
Parameter name: Microsoft.Xrm.Sdk.InvalidPluginExecutionException: An error occurred in the GWS plug-in. ---> System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]: This workflow job was canceled because the workflow that started it included an infinite loop. Correct the workflow logic and try again. For information about workflow logic, see Help.

Server stack trace: 
   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: 
   at Microsoft.Crm.Sandbox.SandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object sandboxTraceSettingsObj)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [1]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at Microsoft.Crm.Sandbox.ISandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object traceSettings)
   at Microsoft.Crm.Sandbox.SandboxOrganizationServiceWrapper.ExecuteInternal(OrganizationRequest request)
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   --- End of inner exception stack trace ---
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   at GWSPlugins.FrequentieBerekening.Execute(IServiceProvider serviceProvider)

Server stack trace: 
   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: 
   at Microsoft.Crm.Sandbox.SandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object sandboxTraceSettingsObj)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [1]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at Microsoft.Crm.Sandbox.ISandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object traceSettings)
   at Microsoft.Crm.Sandbox.SandboxOrganizationServiceWrapper.ExecuteInternal(OrganizationRequest request)
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   --- End of inner exception stack trace ---
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   at GWSPlugins.FrequentieBerekening.Execute(IServiceProvider serviceProvider)

Server stack trace: 
   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: 
   at Microsoft.Crm.Sandbox.SandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object sandboxTraceSettingsObj)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [1]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at Microsoft.Crm.Sandbox.ISandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object traceSettings)
   at Microsoft.Crm.Sandbox.SandboxOrganizationServiceWrapper.ExecuteInternal(OrganizationRequest request)
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   --- End of inner exception stack trace ---
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   at GWSPlugins.FrequentieBerekening.Execute(IServiceProvider serviceProvider)

Server stack trace: 
   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: 
   at Microsoft.Crm.Sandbox.SandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object sandboxTraceSettingsObj)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [1]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at Microsoft.Crm.Sandbox.ISandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object traceSettings)
   at Microsoft.Crm.Sandbox.SandboxOrganizationServiceWrapper.ExecuteInternal(OrganizationRequest request)
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   --- End of inner exception stack trace ---
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   at GWSPlugins.FrequentieBerekening.Execute(IServiceProvider serviceProvider)

Server stack trace: 
   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: 
   at Microsoft.Crm.Sandbox.SandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object sandboxTraceSettingsObj)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [1]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at Microsoft.Crm.Sandbox.ISandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object traceSettings)
   at Microsoft.Crm.Sandbox.SandboxOrganizationServiceWrapper.ExecuteInternal(OrganizationRequest request)
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   --- End of inner exception stack trace ---
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   at GWSPlugins.FrequentieBerekening.Execute(IServiceProvider serviceProvider)

Server stack trace: 
   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: 
   at Microsoft.Crm.Sandbox.SandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object sandboxTraceSettingsObj)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [1]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at Microsoft.Crm.Sandbox.ISandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object traceSettings)
   at Microsoft.Crm.Sandbox.SandboxOrganizationServiceWrapper.ExecuteInternal(OrganizationRequest request)
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   --- End of inner exception stack trace ---
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   at GWSPlugins.FrequentieBerekening.Execute(IServiceProvider serviceProvider)

Server stack trace: 
   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: 
   at Microsoft.Crm.Sandbox.SandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object sandboxTraceSettingsObj)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [1]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at Microsoft.Crm.Sandbox.ISandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object traceSettings)
   at Microsoft.Crm.Sandbox.SandboxOrganizationServiceWrapper.ExecuteInternal(OrganizationRequest request)
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   --- End of inner exception stack trace ---
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   at GWSPlugins.FrequentieBerekening.Execute(IServiceProvider serviceProvider)

Server stack trace: 
   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: 
   at Microsoft.Crm.Sandbox.SandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object sandboxTraceSettingsObj)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [1]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at Microsoft.Crm.Sandbox.ISandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object traceSettings)
   at Microsoft.Crm.Sandbox.SandboxOrganizationServiceWrapper.ExecuteInternal(OrganizationRequest request)
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   --- End of inner exception stack trace ---
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   at GWSPlugins.FrequentieBerekening.Execute(IServiceProvider serviceProvider)

Server stack trace: 
   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: 
   at Microsoft.Crm.Sandbox.SandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object sandboxTraceSettingsObj)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [1]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at Microsoft.Crm.Sandbox.ISandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object traceSettings)
   at Microsoft.Crm.Sandbox.SandboxOrganizationServiceWrapper.ExecuteInternal(OrganizationRequest request)
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   --- End of inner exception stack trace ---
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   at GWSPlugins.FrequentieBerekening.Execute(IServiceProvider serviceProvider)

Server stack trace: 
   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: 
   at Microsoft.Crm.Sandbox.SandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object sandboxTraceSettingsObj)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [1]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at Microsoft.Crm.Sandbox.ISandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object traceSettings)
   at Microsoft.Crm.Sandbox.SandboxOrganizationServiceWrapper.ExecuteInternal(OrganizationRequest request)
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   --- End of inner exception stack trace ---
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   at GWSPlugins.FrequentieBerekening.Execute(IServiceProvider serviceProvider)

Server stack trace: 
   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: 
   at Microsoft.Crm.Sandbox.SandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object sandboxTraceSettingsObj)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [1]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at Microsoft.Crm.Sandbox.ISandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object traceSettings)
   at Microsoft.Crm.Sandbox.SandboxOrganizationServiceWrapper.ExecuteInternal(OrganizationRequest request)
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   --- End of inner exception stack trace ---
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   at GWSPlugins.FrequentieBerekening.Execute(IServiceProvider serviceProvider)

Server stack trace: 
   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: 
   at Microsoft.Crm.Sandbox.SandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object sandboxTraceSettingsObj)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [1]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at Microsoft.Crm.Sandbox.ISandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object traceSettings)
   at Microsoft.Crm.Sandbox.SandboxOrganizationServiceWrapper.ExecuteInternal(OrganizationRequest request)
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   --- End of inner exception stack trace ---
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   at GWSPlugins.FrequentieBerekening.Execute(IServiceProvider serviceProvider)

Server stack trace: 
   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: 
   at Microsoft.Crm.Sandbox.SandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object sandboxTraceSettingsObj)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [1]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at Microsoft.Crm.Sandbox.ISandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object traceSettings)
   at Microsoft.Crm.Sandbox.SandboxOrganizationServiceWrapper.ExecuteInternal(OrganizationRequest request)
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   --- End of inner exception stack trace ---
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   at GWSPlugins.FrequentieBerekening.Execute(IServiceProvider serviceProvider)

Server stack trace: 
   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: 
   at Microsoft.Crm.Sandbox.SandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object sandboxTraceSettingsObj)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [1]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at Microsoft.Crm.Sandbox.ISandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object traceSettings)
   at Microsoft.Crm.Sandbox.SandboxOrganizationServiceWrapper.ExecuteInternal(OrganizationRequest request)
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   --- End of inner exception stack trace ---
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   at GWSPlugins.FrequentieBerekening.Execute(IServiceProvider serviceProvider)

Server stack trace: 
   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: 
   at Microsoft.Crm.Sandbox.SandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object sandboxTraceSettingsObj)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [1]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at Microsoft.Crm.Sandbox.ISandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object traceSettings)
   at Microsoft.Crm.Sandbox.SandboxOrganizationServiceWrapper.ExecuteInternal(OrganizationRequest request)
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   --- End of inner exception stack trace ---
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   at GWSPlugins.FrequentieBerekening.Execute(IServiceProvider serviceProvider)Detail: 
<OrganizationServiceFault xmlns:i="www.w3.org/.../XMLSchema-instance" xmlns="schemas.microsoft.com/.../Contracts">
  <ActivityId>4a126400-ca6d-489a-99ff-c225787b1041</ActivityId>
  <ErrorCode>-2147220956</ErrorCode>
  <ErrorDetails xmlns:d2p1="schemas.datacontract.org/.../System.Collections.Generic" />
  <Message>Unexpected exception from plug-in (Execute): GWSPlugins.FrequentieBerekening: System.ArgumentNullException: Value cannot be null.
Parameter name: Microsoft.Xrm.Sdk.InvalidPluginExecutionException: An error occurred in the GWS plug-in. ---&gt; System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]: Unexpected exception from plug-in (Execute): GWSPlugins.FrequentieBerekening: System.ArgumentNullException: Value cannot be null.
Parameter name: Microsoft.Xrm.Sdk.InvalidPluginExecutionException: An error occurred in the GWS plug-in. ---&gt; System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]: Unexpected exception from plug-in (Execute): GWSPlugins.FrequentieBerekening: System.ArgumentNullException: Value cannot be null.
Parameter name: Microsoft.Xrm.Sdk.InvalidPluginExecutionException: An error occurred in the GWS plug-in. ---&gt; System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]: Unexpected exception from plug-in (Execute): GWSPlugins.FrequentieBerekening: System.ArgumentNullException: Value cannot be null.
Parameter name: Microsoft.Xrm.Sdk.InvalidPluginExecutionException: An error occurred in the GWS plug-in. ---&gt; System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]: Unexpected exception from plug-in (Execute): GWSPlugins.FrequentieBerekening: System.ArgumentNullException: Value cannot be null.
Parameter name: Microsoft.Xrm.Sdk.InvalidPluginExecutionException: An error occurred in the GWS plug-in. ---&gt; System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]: Unexpected exception from plug-in (Execute): GWSPlugins.FrequentieBerekening: System.ArgumentNullException: Value cannot be null.
Parameter name: Microsoft.Xrm.Sdk.InvalidPluginExecutionException: An error occurred in the GWS plug-in. ---&gt; System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]: Unexpected exception from plug-in (Execute): GWSPlugins.FrequentieBerekening: System.ArgumentNullException: Value cannot be null.
Parameter name: Microsoft.Xrm.Sdk.InvalidPluginExecutionException: An error occurred in the GWS plug-in. ---&gt; System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]: Unexpected exception from plug-in (Execute): GWSPlugins.FrequentieBerekening: System.ArgumentNullException: Value cannot be null.
Parameter name: Microsoft.Xrm.Sdk.InvalidPluginExecutionException: An error occurred in the GWS plug-in. ---&gt; System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]: Unexpected exception from plug-in (Execute): GWSPlugins.FrequentieBerekening: System.ArgumentNullException: Value cannot be null.
Parameter name: Microsoft.Xrm.Sdk.InvalidPluginExecutionException: An error occurred in the GWS plug-in. ---&gt; System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]: Unexpected exception from plug-in (Execute): GWSPlugins.FrequentieBerekening: System.ArgumentNullException: Value cannot be null.
Parameter name: Microsoft.Xrm.Sdk.InvalidPluginExecutionException: An error occurred in the GWS plug-in. ---&gt; System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]: Unexpected exception from plug-in (Execute): GWSPlugins.FrequentieBerekening: System.ArgumentNullException: Value cannot be null.
Parameter name: Microsoft.Xrm.Sdk.InvalidPluginExecutionException: An error occurred in the GWS plug-in. ---&gt; System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]: Unexpected exception from plug-in (Execute): GWSPlugins.FrequentieBerekening: System.ArgumentNullException: Value cannot be null.
Parameter name: Microsoft.Xrm.Sdk.InvalidPluginExecutionException: An error occurred in the GWS plug-in. ---&gt; System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]: Unexpected exception from plug-in (Execute): GWSPlugins.FrequentieBerekening: System.ArgumentNullException: Value cannot be null.
Parameter name: Microsoft.Xrm.Sdk.InvalidPluginExecutionException: An error occurred in the GWS plug-in. ---&gt; System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]: Unexpected exception from plug-in (Execute): GWSPlugins.FrequentieBerekening: System.ArgumentNullException: Value cannot be null.
Parameter name: Microsoft.Xrm.Sdk.InvalidPluginExecutionException: An error occurred in the GWS plug-in. ---&gt; System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]: Unexpected exception from plug-in (Execute): GWSPlugins.FrequentieBerekening: System.ArgumentNullException: Value cannot be null.
Parameter name: Microsoft.Xrm.Sdk.InvalidPluginExecutionException: An error occurred in the GWS plug-in. ---&gt; System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]: This workflow job was canceled because the workflow that started it included an infinite loop. Correct the workflow logic and try again. For information about workflow logic, see Help.

Server stack trace: 
   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc&amp; rpc)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: 
   at Microsoft.Crm.Sandbox.SandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object sandboxTraceSettingsObj)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]&amp; outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [1]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp; msgData, Int32 type)
   at Microsoft.Crm.Sandbox.ISandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object traceSettings)
   at Microsoft.Crm.Sandbox.SandboxOrganizationServiceWrapper.ExecuteInternal(OrganizationRequest request)
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   --- End of inner exception stack trace ---
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   at GWSPlugins.FrequentieBerekening.Execute(IServiceProvider serviceProvider)

Server stack trace: 
   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc&amp; rpc)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: 
   at Microsoft.Crm.Sandbox.SandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object sandboxTraceSettingsObj)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]&amp; outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [1]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp; msgData, Int32 type)
   at Microsoft.Crm.Sandbox.ISandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object traceSettings)
   at Microsoft.Crm.Sandbox.SandboxOrganizationServiceWrapper.ExecuteInternal(OrganizationRequest request)
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   --- End of inner exception stack trace ---
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   at GWSPlugins.FrequentieBerekening.Execute(IServiceProvider serviceProvider)

Server stack trace: 
   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc&amp; rpc)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: 
   at Microsoft.Crm.Sandbox.SandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object sandboxTraceSettingsObj)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]&amp; outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [1]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp; msgData, Int32 type)
   at Microsoft.Crm.Sandbox.ISandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object traceSettings)
   at Microsoft.Crm.Sandbox.SandboxOrganizationServiceWrapper.ExecuteInternal(OrganizationRequest request)
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   --- End of inner exception stack trace ---
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   at GWSPlugins.FrequentieBerekening.Execute(IServiceProvider serviceProvider)

Server stack trace: 
   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc&amp; rpc)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: 
   at Microsoft.Crm.Sandbox.SandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object sandboxTraceSettingsObj)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]&amp; outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [1]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp; msgData, Int32 type)
   at Microsoft.Crm.Sandbox.ISandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object traceSettings)
   at Microsoft.Crm.Sandbox.SandboxOrganizationServiceWrapper.ExecuteInternal(OrganizationRequest request)
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   --- End of inner exception stack trace ---
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   at GWSPlugins.FrequentieBerekening.Execute(IServiceProvider serviceProvider)

Server stack trace: 
   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc&amp; rpc)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: 
   at Microsoft.Crm.Sandbox.SandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object sandboxTraceSettingsObj)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]&amp; outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [1]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp; msgData, Int32 type)
   at Microsoft.Crm.Sandbox.ISandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object traceSettings)
   at Microsoft.Crm.Sandbox.SandboxOrganizationServiceWrapper.ExecuteInternal(OrganizationRequest request)
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   --- End of inner exception stack trace ---
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   at GWSPlugins.FrequentieBerekening.Execute(IServiceProvider serviceProvider)

Server stack trace: 
   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc&amp; rpc)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: 
   at Microsoft.Crm.Sandbox.SandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object sandboxTraceSettingsObj)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]&amp; outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [1]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp; msgData, Int32 type)
   at Microsoft.Crm.Sandbox.ISandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object traceSettings)
   at Microsoft.Crm.Sandbox.SandboxOrganizationServiceWrapper.ExecuteInternal(OrganizationRequest request)
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   --- End of inner exception stack trace ---
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   at GWSPlugins.FrequentieBerekening.Execute(IServiceProvider serviceProvider)

Server stack trace: 
   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc&amp; rpc)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: 
   at Microsoft.Crm.Sandbox.SandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object sandboxTraceSettingsObj)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]&amp; outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [1]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp; msgData, Int32 type)
   at Microsoft.Crm.Sandbox.ISandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object traceSettings)
   at Microsoft.Crm.Sandbox.SandboxOrganizationServiceWrapper.ExecuteInternal(OrganizationRequest request)
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   --- End of inner exception stack trace ---
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   at GWSPlugins.FrequentieBerekening.Execute(IServiceProvider serviceProvider)

Server stack trace: 
   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc&amp; rpc)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: 
   at Microsoft.Crm.Sandbox.SandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object sandboxTraceSettingsObj)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]&amp; outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [1]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp; msgData, Int32 type)
   at Microsoft.Crm.Sandbox.ISandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object traceSettings)
   at Microsoft.Crm.Sandbox.SandboxOrganizationServiceWrapper.ExecuteInternal(OrganizationRequest request)
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   --- End of inner exception stack trace ---
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   at GWSPlugins.FrequentieBerekening.Execute(IServiceProvider serviceProvider)

Server stack trace: 
   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc&amp; rpc)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: 
   at Microsoft.Crm.Sandbox.SandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object sandboxTraceSettingsObj)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]&amp; outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [1]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp; msgData, Int32 type)
   at Microsoft.Crm.Sandbox.ISandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object traceSettings)
   at Microsoft.Crm.Sandbox.SandboxOrganizationServiceWrapper.ExecuteInternal(OrganizationRequest request)
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   --- End of inner exception stack trace ---
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   at GWSPlugins.FrequentieBerekening.Execute(IServiceProvider serviceProvider)

Server stack trace: 
   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc&amp; rpc)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: 
   at Microsoft.Crm.Sandbox.SandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object sandboxTraceSettingsObj)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]&amp; outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [1]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp; msgData, Int32 type)
   at Microsoft.Crm.Sandbox.ISandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object traceSettings)
   at Microsoft.Crm.Sandbox.SandboxOrganizationServiceWrapper.ExecuteInternal(OrganizationRequest request)
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   --- End of inner exception stack trace ---
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   at GWSPlugins.FrequentieBerekening.Execute(IServiceProvider serviceProvider)

Server stack trace: 
   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc&amp; rpc)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: 
   at Microsoft.Crm.Sandbox.SandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object sandboxTraceSettingsObj)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]&amp; outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [1]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp; msgData, Int32 type)
   at Microsoft.Crm.Sandbox.ISandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object traceSettings)
   at Microsoft.Crm.Sandbox.SandboxOrganizationServiceWrapper.ExecuteInternal(OrganizationRequest request)
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   --- End of inner exception stack trace ---
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   at GWSPlugins.FrequentieBerekening.Execute(IServiceProvider serviceProvider)

Server stack trace: 
   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc&amp; rpc)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: 
   at Microsoft.Crm.Sandbox.SandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object sandboxTraceSettingsObj)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]&amp; outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [1]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp; msgData, Int32 type)
   at Microsoft.Crm.Sandbox.ISandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object traceSettings)
   at Microsoft.Crm.Sandbox.SandboxOrganizationServiceWrapper.ExecuteInternal(OrganizationRequest request)
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   --- End of inner exception stack trace ---
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   at GWSPlugins.FrequentieBerekening.Execute(IServiceProvider serviceProvider)

Server stack trace: 
   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc&amp; rpc)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: 
   at Microsoft.Crm.Sandbox.SandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object sandboxTraceSettingsObj)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]&amp; outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [1]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp; msgData, Int32 type)
   at Microsoft.Crm.Sandbox.ISandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object traceSettings)
   at Microsoft.Crm.Sandbox.SandboxOrganizationServiceWrapper.ExecuteInternal(OrganizationRequest request)
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   --- End of inner exception stack trace ---
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   at GWSPlugins.FrequentieBerekening.Execute(IServiceProvider serviceProvider)

Server stack trace: 
   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc&amp; rpc)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: 
   at Microsoft.Crm.Sandbox.SandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object sandboxTraceSettingsObj)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]&amp; outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [1]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp; msgData, Int32 type)
   at Microsoft.Crm.Sandbox.ISandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object traceSettings)
   at Microsoft.Crm.Sandbox.SandboxOrganizationServiceWrapper.ExecuteInternal(OrganizationRequest request)
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   --- End of inner exception stack trace ---
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   at GWSPlugins.FrequentieBerekening.Execute(IServiceProvider serviceProvider)

Server stack trace: 
   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc&amp; rpc)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: 
   at Microsoft.Crm.Sandbox.SandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object sandboxTraceSettingsObj)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]&amp; outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [1]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp; msgData, Int32 type)
   at Microsoft.Crm.Sandbox.ISandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object traceSettings)
   at Microsoft.Crm.Sandbox.SandboxOrganizationServiceWrapper.ExecuteInternal(OrganizationRequest request)
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   --- End of inner exception stack trace ---
   at GWSPlugins.FrequentieBerekening.CalculateQuote(Entity entity, IOrganizationService service)
   at GWSPlugins.FrequentieBerekening.Execute(IServiceProvider serviceProvider)</Message>
  <Timestamp>2018-05-28T10:23:27.8138662Z</Timestamp>
  <ExceptionRetriable>false</ExceptionRetriable>
  <ExceptionSource i:nil="true" />
  <InnerFault i:nil="true" />
  <OriginalException i:nil="true" />
  <TraceText>

[GWSPlugins: GWSPlugins.FrequentieBerekening]
[d9d8bb42-6062-e811-a83c-000d3ab4bf3c: GWSPlugins.FrequentieBerekening: Update of quote]


</TraceText>
</OrganizationServiceFault>


 

 

 

*This post is locked for comments

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: IPlugin keeps returning error System.ArgumentNullException: Value cannot be null (infinite loop).

    I finally found the solution / problem. The following post helped me out: [View:https://community.dynamics.com/crm/f/117/t/208018:750:50]

    The problem is that at the start of my code, I am retrieving the quote entity, on this quote I am also doing the update. The problem is that, for conditioning checking and retrieving some needed values I did  

    ColumnSet columns = new ColumnSet() { AllColumns = true };

    The downside of this is that on a update it will update all columns, including the frequency column, and thus creating an infinite loop. The posted link states that using 

    AllColumns = true

    is bad practice. 

    I changed the code (the updating part) to the following which fixes the issue:

    Entity updateQuote = new Entity("quote");
                ColumnSet attributes = new ColumnSet(new string[] { "freightamount" });
                updateQuote = service.Retrieve(updateQuote.LogicalName, quoteID, attributes);
                
                updateQuote["freightamount"] = total_frequency_amount;
                service.Update(updateQuote);
  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: IPlugin keeps returning error System.ArgumentNullException: Value cannot be null (infinite loop).

    Good idea, I couldn't find a workflow that was triggered on the same field (frequency), but just in case I added a new frequency field and updated the plugin / workflow with the new field so I would be totally sure no workflow is messing with the code.

    In my workflow, I no longer had the infinite loop error and the freightamount was updated nicely, at least so I though. After refreshing the workflow process I suddenly saw more processes being executed... The first 7 are executed correctly but the following 2 failed (which makes sense).

    So the infinite loop is still there, even with the new frequency field, so this field is not causing it.

    The question is, what is causing this loop then.. I am only updating the freightamount, is a update on this field triggering other events which might corrupt the plugin? I know there is a build in calculation event for the total quote amount, but this shouldn't be causing any problems right?

  • Suggested answer
    Rawish Kumar Profile Picture
    Rawish Kumar 13,756 on at
    RE: IPlugin keeps returning error System.ArgumentNullException: Value cannot be null (infinite loop).

    Okay,

    what i meant is did you check if there is any OOB workflow running on update of this field. ?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: IPlugin keeps returning error System.ArgumentNullException: Value cannot be null (infinite loop).

    Using a workflow instead of the plugin results int he same error:

    This workflow job was canceled because the workflow that started it included an infinite loop. Correct the workflow logic and try again. For information about workflow logic, see Help.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: IPlugin keeps returning error System.ArgumentNullException: Value cannot be null (infinite loop).

    context.Depth is returning 1 when debugging, integrated it, as suggested, to be sure anyway. Workflow is a option which I will test out. For the goal I am trying to achieve, using a Plugin seems to be the better solution though?

  • Suggested answer
    Rawish Kumar Profile Picture
    Rawish Kumar 13,756 on at
    RE: IPlugin keeps returning error System.ArgumentNullException: Value cannot be null (infinite loop).

    what about an out of the box workflow? did you check that?

    also introduce the plugin depth to be on safer side :

    IPluginExecutionContext context = localContext.PluginExecutionContext;

    if (context.Depth > 1)

        return;

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans