gemma-l
6/26/2017 - 10:33 AM

unlock an order in emydex

unlock an order in emydex

--	If you look up the order in the database:
 SELECT * FROM dbo.oms_wo_header
 WHERE WONO = 'PKWO0042455' 
 AND WOVersion = 0

--Then pull out the information in the WOLocking column (see: <LockType>EDIT</LockType>)
 <?xml version="1.0" encoding="utf-16"?>
 <DataLocking xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <LockType>EDIT[</LockType>
   <LockdByWSID>746</LockdByWSID>
   <LockedByUserID>585</LockedByUserID>
   <LockTimestamp>06/06/2017 08:11:51</LockTimestamp>
   <LockTTL>0</LockTTL>
   <LockComment />
 </DataLocking>


--Then edit this xml, setting the <LockType>NONE
 UPDATE dbo.oms_wo_header
 SET WOLocking = '<?xml version="1.0" encoding="utf-16"?>
 <DataLocking xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <LockType>NONE</LockType>
   <LockdByWSID>746</LockdByWSID>
   <LockedByUserID>585</LockedByUserID>
   <LockTimestamp>06/06/2017 07:14:28</LockTimestamp>
   <LockTTL>0</LockTTL>
   <LockComment />
 </DataLocking>'
 WHERE WOType = 'PM_PK' 
 AND WONO = 'PKWO0042455' 
 AND WOVersion = 0


--Reopen the order and it will now be unlocked.