Oops! Deleted the wrong item

Feb 03, 2006 4 Replies

We were adding items on multiple stations and one got duplicated that was already on file. I deleted the duplicate but it turns out I deleted the wrong item. The one I removed was on four layaways. Now I can't recall the layaways (error 204) to fix them. I tried adding back the item with the original lookup code, but that didn't help. How can I fix those four layaways or remove them so they can be re-entered?



Thanks.



Mark S.


when you deleted your item, a record was inserted into the RecordDeletedLog table in the database, if you look there it will tell you what the ID number was of the item you deleted from the item table. When you re-created your item, the ItemLookupCode matched, but the Item ID does not match, this is what is causing your error.

"Mark S" wrote:

What you need to do is update the OrderEntry table and set the ItemID equal to the newly create ItemLookupCode. SELECT Item.ID FROM Item WHERE ItemLookupCode = 'yyy' Make note of the Item.ID Then find the ItemID from the item that was deleted. You can get it from the DeletedRecordLog table or find it in the OrderEntry table. SELECT ItemID FROM OrderEntry WHERE OrderID = 'xxx' OrderID is the Layaway number. Then update the OrderEntry table: UPDATE OrderEntry Set ItemID = 'newitemid' WHERE ItemID = 'olditemid' You could also do this for the TransactionEntry and PurchaseOrderEntry tables.

********************************************************* BEFORE YOU DO ANYTHING MAKE A BACKUP OF YOUR DATABASE *********************************************************

Rob

"Mark S" wrote:

Thanks very much. I will try this tonite. Can the last two tables be ignored if we plan to delete those layaways once we can view them? They have since been recreated.

Mark S

"Rob" wrote:

Can you explain a little further I am not following? "Can the last two tables be ignored if we plan to delete those layaways once we can view them? They have since been recreated." Which last two tables? And what has since been recreated, the layaways?

Rob

"Mark S" wrote:

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required