Tuesday, February 18, 2014

"Background process is running: Exit Aborted" message when trying to close GP

By Steve Endow

I am developing a Dynamics GP VS Tools AddIn for a customer, and while testing the AddIn, I started to get this message when I tried to close GP:

"Background process is running: Exit Aborted"

In my VS Tools AddIn code, I am accessing a table buffer, and during my first few versions of the rough code, I had forgotten to close the tables.  This left them open, and caused GP to think that they were still being accessed.  So I added the following lines to close the table buffers:


But even after that, I would still get the Background Process message from GP.

After further review, I realized that I did not have a Try / Catch block in my code yet.  So an error was causing an exception before the Close commands were processed.

After adding the Close commands in a Finally block, the Background Process message went away.

As my daughter says, "Easy peasy lemon squeezee"...

Update: This issue was discussed by David Musgrave in a blog post back in 2009.  Funny that I had this problem back in 2010 and posted a comment on his blog.  And now four years later, I made the same mistake again!

Steve Endow is a Dynamics GP Certified Trainer and Dynamics GP Certified IT Professional in Los Angeles.  He is also the owner of Precipio Services, which provides Dynamics GP integrations, customizations, and automation solutions.

You can also find him on Google+ and Twitter

No comments: