Tech Support > Microsoft Windows > Windows CRM > CRM 4.0 - Renew contract error
CRM 4.0 - Renew contract error
Posted by Matthias on May 23rd, 2008


I'm using CRM 4.0. The CRM user has all security roles and privileges.

There is a contract that is expired. I want to renew this contract, but I
receive an error.

"An error has occured."

Any ideas? Is this a known issue?

Help is appreciated.

Best regards


Posted by Paul McQuillan on May 23rd, 2008


Either look in the Server Event Log for a record of the Error that has
occurred (could be worth copying and pasting the error on here) or turning
Development Errors on, this then gives you a ugly ASP.NET view of the error
with more detail.

The Service Contracting side of CRM has some very enforced Business Logic,
which can result in errors whenever an operation goes outside this logic -
this is *probably* the cause of your error, but looking at the Event Log or
Development Errors will give you the detail you need to diagnose the error
fully.

(to turn Development Errors on, you change a value in MSCRM's Web.Config
file - google MSCRM+Development Errors and you will find several articles on
how to do this.)

--
Kind Regards, Paul McQuillan.
CRM Consultant


"Matthias" wrote:

Posted by Matthias on May 23rd, 2008


Dear Paul,

tnx for your reply. After enabling DevErrors in web.config I got this:
(Tried to translate German phrases, translation in [] )

-------------------------------------
Error Description:
Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
[The object reference was not assigned to an object instance.]

Error Details:
Eine Ausnahme vom Typ System.Web.HttpUnhandledException wurde ausgelöst.
[An exception of type System.Web.HttpUnhandledException was caused.]

Full Stack:
[NullReferenceException: Der Objektverweis wurde nicht auf eine
Objektinstanz festgelegt.]
bei
Microsoft.Crm.ObjectModel.ContractService.UpdateSt artEndDates(IBusinessEntity
entity, String startName, String endName)
bei Microsoft.Crm.ObjectModel.ContractService.Renew(Gu id contractId,
Int32 status, Boolean includeCanceledLines, ExecutionContext context)

[TargetInvocationException: Ein Aufrufziel hat einen Ausnahmefehler
verursacht.]
bei System.RuntimeMethodHandle._InvokeMethodFast(Objec t target, Object[]
arguments, SignatureStruct& sig, MethodAttributes methodAttributes,
RuntimeTypeHandle typeOwner)
bei System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[]
arguments, Signature sig, MethodAttributes methodAttributes,
RuntimeTypeHandle typeOwner)
bei System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean
skipVisibilityChecks)
bei System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
bei System.Web.Services.Protocols.LogicalMethodInfo.In voke(Object target,
Object[] values)
bei
Microsoft.Crm.Extensibility.InternalOperationPlugi n.Execute(IPluginExecutionContext context)
bei
Microsoft.Crm.Extensibility.PluginStep.Execute(Pip elineExecutionContext
context)
bei Microsoft.Crm.Extensibility.Pipeline.Execute(Pipel ineExecutionContext
context)
bei
Microsoft.Crm.Extensibility.MessageProcessor.Execu te(PipelineExecutionContext
context)
bei
Microsoft.Crm.Extensibility.InternalMessageDispatc her.Execute(PipelineExecutionContext context)
bei Microsoft.Crm.Extensibility.ExternalMessageDispatc her.Execute(String
messageName, Int32 primaryObjectTypeCode, Int32 secondaryObjectTypeCode,
PropertyBag fields, CorrelationToken correlationToken, CallerOriginToken
originToken, UserAuth userAuth, Guid callerId)
bei Microsoft.Crm.Sdk.RequestBase.Process(Int32 primaryObjectTypeCode,
Int32 secondaryObjectTypeCode, CorrelationToken correlationToken,
CallerOriginToken originToken, UserAuth userAuth, Guid callerId)
bei Microsoft.Crm.Sdk.RequestBase.Process(CorrelationT oken
correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid
callerId)
bei Microsoft.Crm.Sdk.CrmServiceInternal.Execute(Reque stBase request,
CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth
userAuth, Guid callerId)
bei Microsoft.Crm.Sdk.InProcessCrmService.Execute(Obje ct request)
bei
Microsoft.Crm.Application.Platform.ServiceCommands .PlatformCommand.ExecuteInternal()
bei
Microsoft.Crm.Application.Platform.ServiceCommands .RenewContractCommand.Execute()
bei Microsoft.Crm.Application.Platform.DataSource.Rene wContract(Guid
contractId, Boolean includeCanceledLines, Int32 newStatus)
bei Microsoft.Crm.Web.CS.ContractPage.renew(Object sender, DataEventArgs e)
bei Microsoft.Crm.Application.Forms.DataEventProcessor .Raise(FormEventId
eventId, FormState state, IUser user, String objectId, Entity entity)
bei Microsoft.Crm.Application.Forms.AppForm.RaiseDataE vent(FormEventId
eventId)
bei Microsoft.Crm.Application.Forms.EndUserForm.Initia lize(Entity entity)
bei Microsoft.Crm.Application.Forms.CustomizableForm.E xecute(Entity
entity, String formType)
bei Microsoft.Crm.Application.Forms.CustomizableForm.E xecute(Entity entity)
bei Microsoft.Crm.Web.CS.ContractPage.ConfigureForm()
bei Microsoft.Crm.Application.Controls.AppUIPage.OnPre Render(EventArgs e)
bei System.Web.UI.Control.PreRenderRecursiveInternal()
bei System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

[HttpUnhandledException: Eine Ausnahme vom Typ
System.Web.HttpUnhandledException wurde ausgelöst.]
bei System.Web.UI.Page.HandleError(Exception e)
bei System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
bei System.Web.UI.Page.ProcessRequest(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
bei System.Web.UI.Page.ProcessRequest()
bei System.Web.UI.Page.ProcessRequestWithNoAssert(Http Context context)
bei System.Web.UI.Page.ProcessRequest(HttpContext context)
bei ASP.vsx_cs_contracts_edit_aspx.ProcessRequest(Http Context context)
bei
System.Web.HttpApplication.CallHandlerExecutionSte p.System.Web.HttpApplication.IExecutionStep.Execut e()
bei System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean&
completedSynchronously)

-------------------------------------------

Is this helpful to determine the problem?

Thank you in advance.

Posted by Paul McQuillan on May 23rd, 2008


Object Reference not found irritatingly been one of those errors that can
mean almost anything! Althrough it would appear that Microsoft CRM is having
trouble creating the new Start/End dates for your Contract Renewal.

What is the Start Date and End Date for the Expired Contract that you are
trying to Renew?

It would also be worth checking wheather you have any custom development on
the Contract entity - so any Javascript running on the Contract Form or any
Plugins active for the Contract entity?

--
Kind Regards, Paul McQuillan.
CRM Consultant


"Matthias" wrote:

Posted by Matthias on May 23rd, 2008


Well, something is strange:

The start date of the expired contract is May 1st 2008

The end date of the expired contract is April 30th 2008

Could that be the problem?

Posted by Paul McQuillan on May 23rd, 2008


That will be it.

When you renew a Contract in MSCRM, it looks at the Start and End Dates of
the the original Contract to determine the length of the original Contract -
so it can create a Renewal Contract with the same length.

So if you have a Contract that Starts in January and ends in February (2
months) - renewing the Contract will create a Renewal running from the Start
of March to the end of April. (the original Contract + a further 2 months)

So in this instance, MSCRM will look at the original Expired Contact -
determine that it has a length of -1 months, and so try to create a Renewal
for a further -1 month --> lots of confusion that will result in Microsoft
CRM giving up and raising the error!

I'd suggest using the 'Copy Contract' option to create a copy of your
expired Contract - and then give this copy the relevant Start and End dates
you want for your renewal. Its not quite the same as renewing the Contract,
but should get round the error.

--
Kind Regards, Paul McQuillan.
CRM Consultant


"Matthias" wrote:

Posted by Matthias on May 23rd, 2008


Thank you!


Similar Posts