Pogo69's Blog

April 1, 2011

Post CRM 2011 Upgrade from CRM 4.0 – Resolve Case Error – Allotment overage is invalid

Filed under: CRM, CRM 2011 Upgrade, SQL Server, Transact SQL — pogo69 [Pat Janes] @ 07:57

We started receiving this error whenever we tried to resolve a Case (incident) after the upgrade of our internal CRM system from 4.0 to 2011.

The exact text of the error message is as follows:

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Allotment overage is invalid.Detail:
<OrganizationServiceFault xmlns:i=”http://www.w3.org/2001/XMLSchema-instance&#8221; xmlns=”http://schemas.microsoft.com/xrm/2011/Contracts”&gt;
<ErrorDetails xmlns:d2p1=”http://schemas.datacontract.org/2004/07/System.Collections.Generic&#8221; />
<Message>Allotment overage is invalid.</Message>
<InnerFault i:nil=”true” />
<TraceText i:nil=”true” />

Which… meant absolutely nothing to me, and nothing to any of the other people suffering from the same issue in a recent thread on the MSDN CRM Forum.

To test my theory that it was only upgraded Contract Lines that cause the error, I created a new Contract and Contract Line and compared them with the pre-existing upgraded versions. ┬áThe offending data is the AllotmentsOverage column in the ContractDetailBase table; for all of the old Contract Lines in our DB post-conversion, the value of this field was NULL, which is obviously invalid (as per the error message we’re all receiving).

I ran a query to update all NULL values to 0 (a new Contract Line that I created for testing had this field set to 0):

update ContractDetailBase set AllotmentsOverage = ISNULL(AllotmentsOverage, 0);

After the update, all was well again!


Blog at WordPress.com.