In Dynamics GP, the users sessions will not clear properly from SQL due to some network error, SQL communication, some common errors and etc.. So, while posting, reconciling or any other process in GP, it won’t allows user to continues the task. For example if you get any errors like “Batch is marked for posting and cannot be edited.” while posting a batch, follow below procedures to clearing the stuck batch/users session from SQL and post the batch without any errors.
Step 1: Make sure that you have a current backup of the company database, and ask all users to exit Microsoft Dynamics GP.
Step 2: Run the following script to view if any any of the users sessions are stuck in SQL tables. If all users are logged off from Microsoft Dynamics GP, these tables will not return any records.
Note: Make sure all users are logged off from Microsoft Dynamics GP.
SELECT * FROM DYNAMICS..ACTIVITY
SELECT * FROM DYNAMICS..SY00800
SELECT * FROM DYNAMICS..SY00801
SELECT * FROM TEMPDB..DEX_LOCK
SELECT * FROM TEMPDB..DEX_SESSION
Step 3: If above queries returned any results, make sure everyone is logged off from GP and run the below query to clear the stuck batch users session from GP. Before running this query make sure that you have a current backup of the company database.
Note: If all users are logged off from Microsoft Dynamics GP, these tables will not return any records.
Step 4: If no results are returned, run the following script against the company database.
UPDATE SY00500 SET MKDTOPST=0, BCHSTTUS=0 where BACHNUMB=’Enter Your Batch ID’
Hope this helps!!!