Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)
Answered

Object Reference Not Set Error

(1) ShareShare
ReportReport
Posted on by 3,542

I was doing an example on form extension.

The example includes creating a custom filter control on the MainAccount form.

I tried some of my own stuff, which went wrong. I received the following errors: "Object reference not set to an instance of an object. The menu item with name mainaccountdetails could not be opened."

1. I looked for the problem in my extension class. Could not find it.

2. Commented out all my code on the extension class for the form. No difference.

3. Deleted the extension class. No difference.

4. Deleted the extension form. No difference.

5. Deleted the project. No difference.

6. In visual studio d365 - model management - refresh models. Nothing.

So I still have the error. It would be great if someone can point me in a direction.

*This post is locked for comments

  • Thomas Vogt Poulsen Profile Picture
    345 on at
    RE: Object Reference Not Set Error

    Exactly, so if we are building DLLs from a somehow faulty source code, runtime error might occur. Of course I had to build my customized elements again. 

  • nmaenpaa Profile Picture
    101,158 Moderator on at
    RE: Object Reference Not Set Error

    That's quite strange since the models (source code) don't have any impact on the runtime. The runtime uses the dll which is the result of building the model(s).

  • Thomas Vogt Poulsen Profile Picture
    345 on at
    RE: Object Reference Not Set Error

    This fixed my issue as well.

    Stop AOS batch service and delete the model directory in the AOSService folder. Then restart and reimport the model from the Source control, and refresh models.

  • Verified answer
    Pete Alberts Profile Picture
    3,542 on at
    RE: Object Reference Not Set Error

    I deleted the model (in which the extension was) in the AOSService folder. Which did the trick - I didn't even build anything.

  • Pete Alberts Profile Picture
    3,542 on at
    RE: Object Reference Not Set Error

    The question on trees: community.dynamics.com/.../273379

    But I already solved the problem with a decent (in my opinion) method. Will be posting it soon.

    I'll try building again sometime (as it takes so long) - at the moment I'm just living without the entire accounts model lol. I'll post again if it doesn't solve the problem.

    Thank you very much.

  • Sukrut Parab Profile Picture
    71,687 Moderator on at
    RE: Object Reference Not Set Error

    HI Pete ,

    You can just select your extension package and base package from model parameters . select just check box and start build if you want selective package otherwise trying a full build is also option . Which other question (something with tree) you are talking about

  • Pete Alberts Profile Picture
    3,542 on at
    RE: Object Reference Not Set Error

    There were no errors. I quit the full build because it was taking too long - noob error lol.

    I'll do a full build tonight. I don't know what else there is left to do/try.......

  • Suggested answer
    Nishant2408 Profile Picture
    705 on at
    RE: Object Reference Not Set Error

    have you checked that you completed your build successfully without any errors?

    How ever in my previous reply, I have mentioned that you have to build reference packages as well. Build should complete without any errors otherwise if any error is there that is of no use, no changes you will find.

  • Pete Alberts Profile Picture
    3,542 on at
    RE: Object Reference Not Set Error

    Build with referenced packages didn't work. I'm doing a full build now....

  • Pete Alberts Profile Picture
    3,542 on at
    RE: Object Reference Not Set Error

    I built the Ledger package - no success. I am now building it with referenced packages (takes quite a while). Sukrut mentioned I should build the extension. Is there anything specific I should do to accomplish that?

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics AX (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 100 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 46

#3
shanawaz davood basha Profile Picture

shanawaz davood basha 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans