Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

What is the best way to deal with error "Object reference not set to an instance of an object" ?

(0) ShareShare
ReportReport
Posted on by 305

Hi guys,

I have a custom form which in it there is process by clicking some button. If I check with few scenario at my DevBox there is no error, but in UAT there is this error :  "Object reference not set to an instance of an object" 

pastedimage1678334096682v1.png

What is the best way to trace this kind of error ? Since there is no other message, and I can't debug it in UAT. I tried with the same scenario, same data entry, but obviously cannot 100% the exact same data for all the linking when processing the whole relation of it like master data or other configuration. 

Thanks,

  • Martin Dráb Profile Picture
    Martin Dráb 230,962 Most Valuable Professional on at
    RE: What is the best way to deal with error "Object reference not set to an instance of an object" ?

    If it's coming from code, the only way is avoiding the attempt to call method on nothing (null), because it makes no sense and it must fail. Maybe there shouldn't ever be null and there is a bug causing that. Or it may be null in come case and you need to check the value before using it.

    Regarding debugging, you can even configure a DEV environment to connect to the database of another (non-production) environment.

  • Suggested answer
    Mohit Rampal Profile Picture
    Mohit Rampal 12,554 Super User 2024 Season 1 on at
    RE: What is the best way to deal with error "Object reference not set to an instance of an object" ?

    Hi Axel, You can restore UAT Database in Dev to replicate issue or another way is to debug UAT environment from your Devbox.

    Check this article

    aristonjavier.wordpress.com/.../

    If even after Database restore, its not replicated then it might be code merge issue, so ensure that your changes are merged & deployed properly in UAT

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,160 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,962 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans