Knowledge found and lost while working with Microsoft Dynamics CRM
RSS icon Home icon
  • Error message when you try to save a record in Microsoft Dynamics CRM 4.0: "Object reference not set to an instance of an object"

    Posted on January 27th, 2010 Mitch Milam Print Print 1 comment

    http://support.microsoft.com/kb/954018

    I ran into this issue again this week and since it had been so long since I had seen it, it took me a while to remember the solution- which I thought I’d share with you know.

    Problem

    You receive the following message when attempting to save a record:

    Object reference not set to an instance of an object.

     

    Cause

    This problem occurs because a money attribute is created for the entity. When you do this, Microsoft Dynamics CRM 4.0 creates an exchangerate attribute to work together with the money attribute. The money attribute is published as part of the entity.

    However, if you delete the money attribute, the exchangerate attribute is not removed. Therefore, when you try to run a Microsoft Dynamics CRM plug-in, the plug-in can find the exchangerate attribute. However, the plug-in cannot find the money attribute

     

    Solution

    Create a new money attribute on the entity.  This attribute will remain unused and does not need to be on the form.

     

    Comments

    Seeing this error is rare.  It occurred in my instance because another developer originally added a field as a money type then realized it wasn’t actually money, it was a float type.  He deleted and recreated the attribute which inadvertently create the problem.

    Dynamics CRM
    1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)
    Loading ... Loading ...
    739 views
     

    One response to “Error message when you try to save a record in Microsoft Dynamics CRM 4.0: "Object reference not set to an instance of an object"”

    1. I was cleaning up CRM by removing some old unused fields from my Project/Opportunity entity …

      When I deleted a Money field it seemed to publish fine after that… but then…

      No users could open a Project/Opportunity Entity and I couldn't publish any changes.

      By re-creating the Money field (exact same name?) everything returned to normal…

      ALWAYS EXPORT ALL CUSTOMIZATIONS BEFORE DELETING FIELDS!

    Leave a reply