The following article explains how to recover a deleted quote through the OrderSavant database. Because this involves database work on the back end, it is recommended that you handle this with great care and that only an expert or administrator runs the following queries.
-
First of all, you are going to want to open OrderSavant and verify that the Order really was deleted (don’t want to fix what isn’t broken!) by searching for the Quote number.
-
Once you have verified that the quote really has been deleted, open SQL Management Studio to access your OrderSavant database.
-
First, you need to find this record in the database. Simply run the following quote. Be sure to replace “Orders.QuoteNumber = XXXXXX” with the actual quote number. Also, be sure to execute this on the correct database!!
SELECT TOP 100 Orders.OrderSys, Orders.OrderName, Orders.CurrentValue, Orders.QuoteNumber, Orders.DateDeleted, Orders.DeletedByUserSys, Users.UserName, Contacts.FirstName, Contacts.LastName FROM Orders, Users, Contacts WHERE Orders.DeletedByUserSys = Users.UserSys AND Users.ContactSys = Contacts.ContactSys AND Orders.QuoteNumber = XXXXXX
-
The query above should give you all the information you need:
-
If nothing shows up, the quote never existed (or you have the wrong quote number).
-
The CurrentValue should be 0 (meaning that it was deleted)
-
The DateDeleted will tell you when this quote/order was deleted.
-
The Username, FirstName, and LastName will tell you exactly who deleted this quote/order.
-
Once you have verified that the Order exists and really was deleted, you can execute the following query to recover the quote/order. Again, remember to replace “QuoteNumber = XXXXXX” with the actual quote number and to execute it on the correct database.
UPDATE Orders SET CurrentValue = 1 WHERE QuoteNumber = XXXXXX
-
Finally, go to OrderSavant and try to search for this Quote Number again. The quote should now show up in the search, and you should be able to open it successfully.
-
Don’t forget to close any queries you had open and close anything you opened on the server.
|