web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

object reference not set to an instance of an object.

(0) ShareShare
ReportReport
Posted on by 6

Hello All,

I have custom entity .

i am calling a sdk update method to update the entity record but getting the object reference error.

serviceproxy.update(custom entity instance);

can anybody let me know what could this error be.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    PS Profile Picture
    23,577 on at

    You need to debug your plugin and see where exactly the error is

    support.microsoft.com/.../2778280

    rajeevpentyala.com/.../debugging-plug-ins-in-crm

  • Suggested answer
    Nithya Gopinath Profile Picture
    17,078 on at

    Hi,

    This error is resolved in the following threads. Please refer it.

    community.dynamics.com/.../168815

    community.dynamics.com/.../169559

  • Suggested answer
    shivaram Profile Picture
    3,315 on at

    Hi,

    Check whether you are getting the Id of a record, which you want to update.

    This is null reference error.

  • Suggested answer
    Alagunellaikumar Profile Picture
    6,212 on at

    Hi

    While debugging,Check whether custom entity instance is null or serviceproxy is null.

  • EmployeeOcta Profile Picture
    6 on at

    Hello Alagu,

    Both the things are not null.

    Both are instantiated.

  • EmployeeOcta Profile Picture
    6 on at

    Hello Shivaram,

    I am getting the id in the entity , but i need to know is there any impact of the related entities as well??

  • shivaram Profile Picture
    3,315 on at

    Can you please tell me that, exactly in which line you are getting error? And paste here your update record code.

  • tw0sh3ds Profile Picture
    5,600 on at

    Hi,

    You need to paste full code here, otherwise it's hard to help. Also are there any plugin on Update of this custom entity?

  • MaKeer Profile Picture
    Microsoft Employee on at

    Post your code snippet, that will make lot easier for Forum members to suggest solutions

  • EmployeeOcta Profile Picture
    6 on at

    using (OrganizationServiceProxy objref=OrganizationServiceProxy())

    {

     Entity location =new Entity(new_CustomEntity)

    location.Attribute["x"]=some value;

    location.Attribute["y"]=some value;

    location.Attribute["z"]=some value;

    location.Attribute["p"]=some value;

    location.Attribute["q"]=some value;

    location.Attribute["r"]=some value;

    objref.Update(location)  // this line giving error . as object reference not set to an instance of an object.

    }

    I cannot put my code as i have restriction .

    So above is the high level idea which i have put in the code format.

    don't go each and every syntax missing or anything else as it is high level put forth.

    Now suggest me what is going to be wrong.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
AS-17030037-0 Profile Picture

AS-17030037-0 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans