That is the frantic call you receive when, during another day at the office, a User goes to check on one of their open Opportunities. When they click on the Opportunity in their view, the record won’t load and they receive an error message.
Of course, the first impulse is to check out if it is a permission issue. When I, as a System Administrator, attempt to access the Opportunity, the same error message is found and even I can’t open it. The first place I look is the Event Viewer. I notice that when I attempted to open the Opportunity, I would get the following error message for the MSCRMWebService:
The Web Service plug-in failed in OrganizationId: 00000000-0000-0000-0000-000000000000; SdkMessageProcessingStepId: 00000000-0000-0000-0000-000000000000; EntityName: opportunity; Stage: 30; MessageName: Retrieve; AssemblyName: Microsoft.Crm.Extensibility.InternalOperationPlugin, Microsoft.Crm.ObjectModel, Version=220.127.116.11, Culture=neutral, PublicKeyToken=31bf3856ad364e35; ClassName: Microsoft.Crm.Extensibility.InternalOperationPlugin; Exception: Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object parameters, Object arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture)
at System.Web.Services.Protocols.LogicalMethodInfo.Invoke(Object target, Object values)
at Microsoft.Crm.Extensibility.InternalOperationPlugin.Execute(IServiceProvider serviceProvider)
at Microsoft.Crm.Extensibility.V5PluginProxyStep.ExecuteInternal(PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context)
Inner Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Crm.Common.ObjectModel.PriceService.CalculateNumerOfUnitsPerDefaultUnit(Guid defaultUomScheduleId, Guid defaultUomId, Guid uomId, ExecutionContext context)
at Microsoft.Crm.Common.ObjectModel.PriceService.CalculatePrice(BusinessEntity entity, Guid lineItemId, Boolean skipQOIDetailPricing, Boolean overridePricePerUnitLock, Boolean overrideDiscountLock, ExecutionContext context)
at Microsoft.Crm.Sales.ObjectModel.OpportunityPriceService.CalculatePrice(BusinessEntity entity, Guid lineItemId, Boolean skipQOIDetailPricing, Boolean overridePricePerUnitLock, Boolean overrideDiscountLock, ExecutionContext context)
at Microsoft.Crm.Sales.ObjectModel.OpportunityPriceService.CalculatePrice(Guid qoiId, Guid lineItemId, Boolean skipLineItemPricing, Boolean overridePricePerUnitLock, Boolean overrideDiscountLock, Boolean isModifiedBySystem, ExecutionContext context)
at Microsoft.Crm.Sales.ObjectModel.OpportunityService.CalculatePrice(Guid qoiId, Guid qoiDetailId, Boolean skipQOIDetailPricing, Boolean overridePricePerUnitLock, Boolean overrideDiscountLock, Boolean isModifiedBySystem, ExecutionContext context)
at Microsoft.Crm.Sales.ObjectModel.CalculatePriceService.DoCalculatePriceInternal(BusinessEntityMoniker moniker, Guid parentId, IOrganizationContext context, String messageName)
at Microsoft.Crm.Sales.ObjectModel.CalculatePriceService.CalculatePrice(BusinessEntityMoniker moniker, Guid parentId, ExecutionContext context)
at Microsoft.Crm.Sales.ObjectModel.QOIService.Retrieve(BusinessEntityMoniker moniker, EntityExpression entityExpression, ExecutionContext context).
Reading after the Inner Exception, you can see that there are a few key pieces of information which are “CalculateNumerOfUnitsPerDefaultUnit” and “CalculatePrice.” What is occurring, is that when an Open Opportunity is viewed, the fields on the Opportunity are being updated and calculated so that the prices are current. What points us in the correct direction, is the former message which is referencing Units of Measure (UoM). The reason why the price won’t calculate is that the UoM on the Opportunity Product is not the same as the default UoM for the Product referenced, or the UoM is not in the Unit Group of the default UoM.
To give a quick background, in all of the environments I have experienced this issue, there is an integration in place with GP. Information about Products is maintained and updated in the GP environment and pushed over to Dynamics CRM. What we are seeing is that the UoM is being updated for the Product in GP, which is correctly updating the Product in CRM.
Where we are getting the error issue is, any Opportunity Product that was created with the modified Product now has an invalid UoM and therefore, the price calculation is unable to complete properly. As Dynamics CRM does not show errors on individual fields or sections, it cancels displaying the Opportunity and presents the error message.
To resolve this, first you’ll need to find out the line item that is causing the issue. If you are able to find out from GP Users what product had the UoM changed, then you are a step ahead. Otherwise, you will want to query in SQL what Opportunity Products on your affected Opportunity have a UoM different from the Products Default UoM. You might have to dig a little deeper and verify that the unit is not in the Unit Group also.
Next, is to update the Opportunity Product UoM so that it is a valid UoM and the GUID matches one associated with the Product. Microsoft does not recommend ever making changes to CRM through SQL and I try to abide by that as much as possible. So the first option is to make the change through an integration tool, if possible. If that is not an option, then you’ll need to update the UoM Id on the opportunity Product through SQL.
Once the UoM has been updated for the Opportunity Product, you should be able to access the Opportunity record without any issue. Keep in mind that you won’t find this error when trying to access any Won or Lost Opportunities, as the fields are locked and the record does not calculate when viewed; but if you reopen an affected Opportunity, then you will receive the error. At least now you know where to look to resolve the issue.
If you would like to learn more about Dynamics CRM please reach out to KTL Solutions at 866-960-0001 or by email at firstname.lastname@example.org.
|SCOTT FLORANCE |CRM Business Software Consultant
Scott Florance is one of the CRM Consultants at KTL and has proven his value as a member of the team since September 2013. Whether implementing a new CRM organization or adding to existing configurations, Scott has engaged clients with a positive and enthusiastic demeanor to help them meet their organizational needs. With four plus years of experience, Scott is familiar with CRM as both a power user and administrator. Scott received his bachelor’s degree in business administration from the University of Central Florida. He is a Microsoft Certified Technology Specialist for Dynamics CRM as well as a Certified Scribe Technician.