Locked Payables Transaction: You cannot display this record while another user is editing it

With sites using Microsoft Dynamics GP over Citrix Presentation or XenApp, where they have set Citrix to time users out after a certain period of inactivity, we occasionally see the following error message when another user tries to open the voucher in Payables Transaction Entry (Transactions >> Purchasing >> Transaction Entry);

This document number already exists. Please enter a new document number.

The problem occurs when a user has a transaction open in Payables Transaction Entry and doesn’t touch GP for a while, such as when they go to lunch or even home for the evening. We have repeatedly stressed to clients that they should close GP down when they leave their desk for a period of time, if only for security purposes along with locking their machine, but this is a battle we seem destined to lose.

If the user, who was locking the transaction, logs back into GP then the lock is automatically removed. But if the user doesn’t log back in before someone else tries to open the invoice they get the above error ad we get a call logged on the helpdesk.

The following SQL is what we have produced to quickly remove the lock entries from ACTIVITY in the system database and DEX_LOCK and DEX_SESSION in tempdb, change the value of the (highlighted) @VCHRNMBR variable to your Voucher Number;

SELECT * FROM tempdb..DEX_LOCK
SELECT * FROM tempdb..DEX_SESSION
SELECT * FROM DYNAMICS..ACTIVITY

DECLARE @Session_ID INT
DECLARE @VCHRNMBR VARCHAR(30)

SET @VCHRNMBR = '00000000000000460'

SET @Session_ID = (
SELECT
   session_id FROM tempdb..DEX_LOCK AS DEX_LOCK (*)
INNER JOIN
   PM10000 AS ['PM Transaction WORK File'] (*)
   ON ['PM Transaction WORK File'].DEX_ROW_ID = DEX_LOCK.row_id
WHERE
   ['PM Transaction WORK File'].VCHRNMBR = @VCHRNMBR
)

IF @Session_ID IS NOT NULL
   BEGIN
      DELETE FROM tempdb..DEX_LOCK WHERE session_id = @Session_ID

      IF (SELECT COUNT(*) FROM tempdb..DEX_SESSION AS DEX_SESSION (*) WHERE DEX_SESSION.session_id = @Session_ID) > 0
         DELETE FROM tempdb..DEX_SESSION WHERE session_id = @Session_ID

      IF (SELECT COUNT(*) FROM dynamics..ACTIVITY AS ACTIVITY (*) WHERE ACTIVITY.SQLSESID = @Session_ID) = 0
         DELETE FROM DYNAMICS..ACTIVITY WHERE SQLSESID = @Session_ID
   END

As always with scripts be careful when running them; especially in this case make sure the user who is being removed really is not in the system. Once or twice when this was being logged, the user was still actively working on the voucher in question.

Ian Grieve

About Ian Grieve

Ian is a Microsoft Dynamics GP certified consultant specialising in the delivery of Microsoft Dynamics GP projects and currently working for Perfect Image Ltd., a Microsoft Partner and VAR in the North East of England. Ian has worked with Microsoft Dynamics GP since 2003 and, over the nine years since, has dealt with all aspects of the product life-cycle from presales, to implementation, to technical and functional training, to post go-live support and subsequent upgrades and process reviews. In his spare time, Ian runs the azurecurve | Ramblings of a Dynamics GP Consultant blog dedicated to Microsoft Dynamics GP and related products.
This entry was posted in Dynamics, GP, Microsoft and tagged , , , , , . Bookmark the permalink.

2 comments on “Locked Payables Transaction: You cannot display this record while another user is editing it

  1. Pingback: Locked Payables Transaction: You cannot display this record while another user is editing it | | Interesting Findings & Knowledge Sharing

  2. Pingback: Everything Dynamics GP #36 | Interesting Findings & Knowledge Sharing

Leave a Reply

Your email address will not be published. Required fields are marked *

*

* Copy This Password *

* Type Or Paste Password Here *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>