Object reference not set to an instance of an object.


I have a strange issue that has popped up. We restored our database from a back-up with SSMS and when we restored it we are getting the following error ONLY when viewing units,

“Object reference not set to an instance of an object.”

If you do not hit ignore on the issue the program closes. I have found a KB article here through Google referring to the exact same issue. I have gone through all of the units and cannot find any non-text characters and cannot narrow down the issue to even a group of units. It seems to occur no matter how many or what filtering you do. As soon as you hit the “Units” button on the left of the screen the error pops up. I am wondering if there is an easy way to find WHERE the issue is occurring as Aya is not identifying the trouble record in the grid view. Is there anything specific that can be causing the issue that we can look into closer??

** UPDATE **

I also wanted to put a picture on here showing what happens when on a WO a unit is called. The “Object reference” error shows as soon as unit details are requested, you must ignore the issue or the program crashed but the menus fail to load resulting in the following:

Aya Unit Issue Picture.jpg

Hello FourAlarm

At this point we do not have enough information to say this is due to a specific unit or specifically a non-text issue, and to make a specific recommendation. But no problem, let’s narrow down the specifics that will help us together resolve:

You wrote that the message “Object reference not set to an instance of an object.” occurs when you select the Units on the left
I am not sure if you ONLY mean the Units grid, or if you mean any grid of the Units navigation pane.
Please confirm WHICH specific grid(s) of the Units navigation pane results in this specific error. As not sure from your message if the error occurs ONLY when viewing the Units grid, AND/OR ALSO occurs when viewing the Unit Models grid, AND/OR ALSO occurs when viewing the Loan Items grid

Your update with screenshot shows unit entry screen overlaid on top of a workorder, with no menu bar - what it looks like after selecting the Unit jump button with a specific selected unit owned by this client, then receiving message "“Object reference not set to an instance of an object.” and clicking Ignore.
Please confirm : does this occur for ANY unit selected in a workorder item for ANY client?
Or just occurs for specific unit for specific client, or specific units of a specific client, or specific units of specific clients?

You wrote this occurs since restoring from backup. How long ago did you restore? Are you able to restore again to see if that resolves? (don’t actually do it yet, just say so please).

What is the exact version of AyaNova in use?
AyaNova version numbers are 4 separate numbers plus possibly a hotfix number such as the latest version which is 9) (and hotfix 11 on the GZTW.AyaNova.BLL.dll file)
It is possible that an existing fix that resolved an issue in an earlier version will resolve this.

Does this occur for specific AyaNova user(s) only, or for ALL AyaNova users of your database? What is the specific result of performing the exact same steps except the ONLY difference is who logged in as?

Does this occur on a specific computer(s) or any and all computers? What is the specific result of performing the exact same steps logged in as the exact same user, but on different computers?

Does this occur (repeating the exact same steps when testing of course - exact same login, exact same steps, exact same grid loaded to, etc etc) with only with a config.txt data portal connection, or occurs with either a data portal config.txt connection OR a regular network config.txt connection?
As this narrows down if the issue has to do with the connection.

  • Joyce

The error occurs the moment you click the “Units” button in the lower left. Then you are fine as long you do not click the “Units” button in the upper left. If you do the error reoccurs.

This issue occurs with ALL clients, all units, and any workorder. With the workorders the error only occurs when the unit detail are called about the unit. The workorders load fine. There is also an issue printing some reports, details on this can be given but again it seems to be reports that focus on unit details have issues.

AYA DETAILS: (All newly installed software was downloaded from the site and installed as a local admin)

Primary assembly: AyaNova.exe (Hotfix 9)
Primary assembly location: file:///C:/Program Files (x86)/Ground Zero Tech-Works Inc/AyaNova/AyaNova.exe
Business object assembly: GZTW.AyaNova.BLL.dll (Hotfix 11)
Infragistics2.Win.UltraWinGrid.v10.3 10.3.20103.1000
Infragistics2.Win.UltraWinToolbars.v10.3 10.3.20103.1000
Infragistics2.Win.UltraWinEditors.v10.3 10.3.20103.1000
Infragistics2.Win.Misc.v10.3 10.3.20103.1000
Infragistics2.Win.v10.3 10.3.20103.1000
Infragistics2.Win.UltraWinExplorerBar.v10.3 10.3.20103.1000
Infragistics2.Win.UltraWinTree.v10.3 10.3.20103.1000
Infragistics2.Win.UltraWinDock.v10.3 10.3.20103.1000
Infragistics2.Win.UltraWinTabControl.v10.3 10.3.20103.1000
Infragistics2.Shared.v10.3 10.3.20103.1000
mscorlib 1.0.5000.0
DataPortal diagnostics:
PORTAL: Machine name: ATLAS
PORTAL: OS user name: ASP.NET v4.0
PORTAL: OS user domain name: IIS APPPOOL


This error occurs with all users on all computers. Security level, access or anything does not seem to have an effect. From the actual server that calls the DB directly through the SQL server to the workstations that call the DB through the dataportal. I hope this sheds some light on the issue and maybe get us pointed in the right direction.

Scott Foster

Hello Scott

Thank you for providing additional details so together we can narrow down the specific instances when and where occurs which will help with troubleshooting.

What I would suggest is we do steps to see if perhaps tied to some specific data by our troubleshooting steps not using any specific data - do the following and let me know:

Exit out of AyaNova.
Log into AyaNova as AyaNova Administrator.
Create a test client with ONLY a client name i.e. TEST CLIENT. No other info entered, not using a service template, etc.
Create a workorder for this client. Enter no other info in any workorder fields.
From Unit subsection of the workorder, select the Unit jump button to open a new Unit entry screen.
**Do you get the error message “Object reference not set to an instance of an object.” when you open this blank empty Unit entry screen?
If you do, at this point STOP and reply and say so. (select X which yes will close your Ayanova program, or Ignore which attempts to ignore the issue resulting in menu issues etc - X to exit out and then log back in).
If do not receive error, continue with the steps.
Enter in ONLY a serial number (i.e. SN11111), and select this test client, and save this unit.
This unit is now selected in the workorder. Save and exit OUT of the workorder.
Open this same workorder again, that has this test unit already selected. Click on the Unit jump button to open this unit’s entry screen.
**Does the error message “Object reference not set to an instance of an object” display when you click on the Unit jump button in this workorder’s Unit subsection with that test unit already selected?

  • Joyce

Yes the error occurred as soon as we went into the unit entry screen. As error and I have attached a picture, not that it gives a lot of information. It opens again to the details screen without buttons if you ignore the error.

Aya Test Client Issue.jpg

Good morning

Two suggestions:

  1. Have everyone out and AyaNova apps and services closed down.
    Backup the database to a file
    Email us directly, providing a link for us to download
    Include in that email to us specifics on database server and version (i.e. is it SQL Express 2008 R2 or SQL Server 2012 or ??), and login/password for AyaNova Administrator.
    Will have development run a debug and go from there.

  2. Make sure all out and AyaNova apps and services closed down.
    Back up this database and keep.
    Delete the actual SQL AyaNova database via SSMS.
    Restore from a previous backup.
    On a single computer, still not giving others any access, perform exact same steps to attempt to recreate.
    If same error occurs, repeat the steps with an older backup.
    This will not identify what specifically caused this issue, nor what to do to prevent it.
    Let us know.

Wanted to post here for the benefit of any others that may experience similar:

In this specific case, the database is corrupted with numerous duplicated records and corrupted records in at least half of the database tables.
One of the symptoms was the error message “Object reference not set to an instance of an object.” when viewing the Unit grid or Unit entry screen which was due to duplicated Unit report templates records.

Please note that for anyone else experiencing the error message “Object reference not set to an instance of an object.” , this error does not necessarily mean your database is corrupted. It was only in this case, this error message occurred as just one symptom of a number of issues occurring because of this database’s corruption.

The recommended resolution for a corrupted database is to restore from the last known good backup.

FourAlarm, we have sent a specific email regarding options at 1:15PM PST

Please reconfirm our replies have not gone into your Spam folder.
Do contact us via email as soon as possible - letting us know you received or not so we can continue.