locked
Problem after deleting money attribute RRS feed

  • Question

  • I have a custom entity.  I created a money field, published, and then decided 
    we didn't need it to be there anymore, so I deleted it and published again.  Since then, I can no 
    longer save new instances of the entity - we just get an error:
    
    "Object not set to an instance of an object"
    
    On the server, the following event is logged in the application log.
    
    Event Type:	Error
    Event Source:	MSCRMWebService
    Event Category:	None
    Event ID:	18176
    Date:		5/11/2009
    Time:		9:25:35 AM
    User:		N/A
    Computer:	SERVER
    Description:
    Web Service Plug-in failed in OrganizationId: 
    0eb6a303-50e9-4140-903d-e17c7fc6b883; SdkMessageProcessingStepId: 
    f6d4ebbb-0075-407d-8208-26575bfa39af; EntityName: hes_equipment; Stage: 20; 
    MessageName: Create; AssemblyName: 
    Microsoft.Crm.ObjectModel.MultiCurrencyPlugin, Microsoft.Crm.ObjectModel, 
    Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35; ClassName: 
    Microsoft.Crm.ObjectModel.MultiCurrencyPlugin; Exception: Unhandled 
    Exception: System.NullReferenceException: Object reference not set to an 
    instance of an object.
       at 
    Microsoft.Crm.ObjectModel.CalculateBaseMoney.ProcessCalculatedColumns(DynamicEntity 
    entity, BusinessEntity entityPreImage, EntityMetadata entityMetadata, String 
    exchangeRateFieldName, Boolean isCreateOperation, ArrayList 
    unchangedAttributes)
       at 
    Microsoft.Crm.ObjectModel.CalculateBaseMoney.Execute(EntityDataInformation 
    entityDataInformation)
       at 
    Microsoft.Crm.ObjectModel.MultiCurrencyPlugin.Execute(IPluginExecutionContext 
    context)
       at 
    Microsoft.Crm.Extensibility.PluginStep.Execute(PipelineExecutionContext 
    context)
    
    I have tried adding and removing the currency field that was created with 
    the money attribute, but neither seems to make a difference - still get the same 
    error and still cannot save the new instance of the entity.
    
    
    Tuesday, May 12, 2009 1:57 PM

Answers

  • Hi,

    Once you add a money attribute to an entity in CRM 4.0, there always has to be at least one money attribute associated with the entity. It does not have to be displayed on the form, but it has to exist. 

    Solutions
    Create a new money attribute, save and publish, and you won't get the error any longer.

    Cheers!
    • Proposed as answer by Ye Wint Tuesday, May 12, 2009 2:18 PM
    • Marked as answer by Donna EdwardsMVP Tuesday, May 12, 2009 3:28 PM
    Tuesday, May 12, 2009 2:18 PM
  • You will need to create a new money attribute for that entity, but just not put it on the form.


    Cheers,
    Jim

    Jim Wang - MVP Dynamics CRM - http://jianwang.blogspot.com , http://mscrm.cn
    Tuesday, May 12, 2009 2:20 PM
    Moderator

All replies

  • Hi,

    Once you add a money attribute to an entity in CRM 4.0, there always has to be at least one money attribute associated with the entity. It does not have to be displayed on the form, but it has to exist. 

    Solutions
    Create a new money attribute, save and publish, and you won't get the error any longer.

    Cheers!
    • Proposed as answer by Ye Wint Tuesday, May 12, 2009 2:18 PM
    • Marked as answer by Donna EdwardsMVP Tuesday, May 12, 2009 3:28 PM
    Tuesday, May 12, 2009 2:18 PM
  • You will need to create a new money attribute for that entity, but just not put it on the form.


    Cheers,
    Jim

    Jim Wang - MVP Dynamics CRM - http://jianwang.blogspot.com , http://mscrm.cn
    Tuesday, May 12, 2009 2:20 PM
    Moderator