November Happy Hour will be moved to Thursday December 5th.

GDPR: SQL to delete all traces of a purchase order?

Vote:
 

Hi,

What is the best way to delete all traces of a purchase order from the commerce database, based on the tracking number? I know how to resolve the object id from OrderGroup_PurchaseOrder...

Should I delete directly from the tables, or is it preferable to use the stored procedures instead?

I just want to make sure that I delete *all* data related to the purchase order (except data in the catalog, etc :) ).

#221129
Apr 14, 2020 9:31
Sanjay Kumar - Apr 14, 2020 17:57
Hi Patrik,
If you proceed to delete PO with Quan Mai's suggestion so that should be the best approach.
Vote:
 

Hi Patrik, I will suggest stored procedures with the BEGIN TRAN clause once all delete queries execute then COMMIT TRAN else ROLLBACK TRAN for safer hand.

And we also delete PII data from the products so refer below link for deleting GDPR PII data.

https://world.episerver.com/documentation/developer-guides/search-navigation/removing-pii-data-from-the-search-index/filter-pii-data-from-being-indexed/

#221131
Edited, Apr 14, 2020 10:57
Vote:
 

I'm not an GDPR expert, but as far as I understand, orders are financial contracts that override the rules. So you don't have to delete orders to be GDPR-compatible.

In case you really want to delete an order, I suggest to go with API instead

var order = OrderContext.Current.GetPurchaseOrder(trackingNumber);

order.Delete();

order.AcceptChanges();

#221143
Apr 14, 2020 14:55
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.