Reinstate deleted products

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
8 Jahre weitere
Hello, Can anyone help with a SQL code to 'un-delete' products marked as deleted in the database? Any help is appreciated. James
8 Jahre weitere
Hello,

I'm not sure if a product has other related entities that should be un-deleted, but for the products themselves you could do:

UPDATE [dbo].[Product] SET Deleted = 0 WHERE Deleted = 1



You could try for one product, and see if anything else is needed.

Regards

--- Update ---

I just looked in the source code and it seems that the Delete product method only updates that Deleted flag, so the above script should do just fine. See the method below:


  
        /// <summary>
        /// Delete a product
        /// </summary>
        /// <param name="product">Product</param>
        public virtual void DeleteProduct(Product product)
        {
            if (product == null)
                throw new ArgumentNullException("product");

            product.Deleted = true;
            //delete product
            UpdateProduct(product);
        }


8 Jahre weitere
Thank you, that worked! Best regards, James
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.