Tuesday, January 13, 2009

Stuck batches in Dynamics GP

Stuck batches are one of the most common issues in GP. This is caused by a number of issues including:
  • Power fluctuations

  • Data corruption (batch posted but not deleted from SY00500)

  • Transaction errors in batch but Batch Recovery window will not process

  • 3rd party product issues

  • Workstation disconnecting from the server (network connectivity issue or loosing remote connection via citrix or Terminal Server)
The SQL scripts to fix this is found in tech doc #850289. Here they are if you don't have access to PartnerSource. Make sure you kick everyone out of GP and backup up your databases.
DELETE DYNAMICS..ACTIVITY
DELETE DYNAMICS..SY00800
DELETE DYNAMICS..SY00801
DELETE TEMPDB..DEX_LOCK
DELETE TEMPDB..DEX_SESSION
Then use this script to update the status of the batch:
UPDATE SY00500 SET MKDTOPST=0, BCHSTTUS=0 where BACHNUMB='XXX'

Mariano Gomez reminds us of MBS Automated Solutions on his blog. One of the automated solutions in the system series is a batch stuck in posting routine that does this for you manually.

I rarely use any of the above if I have access to SQL. It is a pain to kick people off of the system in the middle of the day so will use enterprise manager/management studio to do this as follows:
  1. Open Enterprise Manager/Management Studio

  2. Choose + sign next to databases

  3. Choose + sign next to database (Dynamics or company database)

  4. Highlight tables and a list of tables should show up on the review pane

  5. Find Table and right click, Choose open table

  6. Delete rows (SY00800, SY00801, or Dex_LCK) or update fields manually by putting your cursor in the field you want to update (MKDTOPST and BCHSTTUS fields in SY00500 table). See screen shot below.



This is somewhat dangerous if you are careless or are unfamiliar with SQL. Still should have a backup when working on the database.

8 Comments:

At January 13, 2009 10:05 PM , Blogger David Musgrave [MSFT] said...

Have a look at the script provided on my blog post:

http://blogs.msdn.com/developingfordynamicsgp/archive/2008/12/03/releasing-stuck-batches-and-transactions-without-exiting-all-users.aspx

You can use it without having to log all users out of the system.

David
http://blogs.msdn.com/DevelopingForDynamicsGP/

 
At January 14, 2009 9:16 AM , Blogger Doug Pitcher said...

Thanks for the comment. Great article. I'll use your script often I believe.

 
At January 16, 2009 7:31 AM , Blogger Sheila said...

Is anyone working on a cure for the batches becoming stuck to begin with? We upgraded to Version 10.0 but it wasn't until several months later that we occassionaly have EFT batches getting stuck when we print remittances/post. Error message says Transaction error in batch but Batch Recovery window will not process. Once batch is realeased we can't find any errors in the batch.

 
At January 19, 2009 10:55 AM , Blogger Doug Pitcher said...

Batches getting stuck have always been a issue. The fix was batch recovery window. Not perfect but at least you don't have to backup everytime you want to post. When you post after you release the batch does it go through? What kind of errors do you get at batch recovery? Probably should trouble shoot the reason it's getting stuck. Lots of times you'd prefer it getting stuck then sending bad data through.

 
At January 20, 2009 1:09 PM , Blogger Sheila said...

Yes, after the batch is released, when we post it does go through. The error says "Data entry errors exist in batch. Use the Batch Recovery window to process this batch. What might I try to troubleshoot why this is happening in the first place. Thank you for responding.

 
At January 22, 2009 9:33 AM , Blogger Doug Pitcher said...

I used David's script yesterday and it worked great.

Sheila, you say this is intermittent? If you release the batch then post and it works it sounds like a connection issue. If you can recreate it try doing dexsql.log. This will tell you where it is hanging up. If it really is stopping workflow you might consider backing up the system before posting. Then restoring to a test company to see if you can recreate after getting the error.

Could also try the support debugging tool David Musgrave help develop (http://blogs.msdn.com/developingfordynamicsgp/archive/2008/07/30/support-debugging-tool-for-microsoft-dynamics-gp.aspx).

I've never tried it but looks like it could give you more information to help resolve the issue.

 
At March 13, 2009 7:19 AM , Anonymous Silvio said...

Great Blog....
I'm a sysadmin with no prior knowledge of Dynamics DP. We have a batch that came out of nowhere (2 years old) stuck in processing. I tried deleting it from sy00800 & sy00500 but it keeps coming back. Now there is another one (also two years old). I plan on following the direction provided, but, I'm not confident I will not screw something else up. Any comments will be greatly appreciated...Silvio

 
At March 16, 2009 12:12 PM , Blogger Doug Pitcher said...

Deleting from the sy00800 and sy00500 tables doesn't really delete the batch. If you ran check links ((File)maintenance>>checklink>>whatever series the batch is in) The batch will come back up.

Run the script from david Musgraves site (see below), then delete the old batches through the user interface if you don't want them anymore. Simple process, hard to mess it up. Do a backup before had though.

Let me know if you have questions.

http://blogs.msdn.com/developingfordynamicsgp/archive/2008/12/03/releasing-stuck-batches-and-transactions-without-exiting-all-users.aspx

 

Post a Comment

<< Home