Deleting a company causes the client to crash

I am trying to delete a company from a Navision 4.0 SP1 SQL database using the SP1 SQL client. When I attempt to do so, the progress dialog pops up showing that it’s deleting records from the Object table. About 15-20 seconds later, the client crashes, rolling everything back.

Has anyone seen this before? I’ve tried to delete the company using multiple clients to no avail.

Another thing that may be of note is that logging onto the company attempts to initialize it. This fails with the error:

“The Report Selections already exists. Identification fields and values: Usage=‘P.Ret.Shpt.’,Sequence=‘1’”

Could the error be stemming from the fact that the company is not fully initialized before attempting to delete it?

Thanks in advance for any advice you can offer!

We’ve resolved this issue. The company was failing to initialize due to some code added to codeunit 2 Company-Initialize that was inserting a duplicate key into the Report Selections table. After initializing the company, I was able to delete it.

Hey Brad,

thanks for giving the solution, its always great when someone solves their own issue, and shares the results.

Much appreciated.