Hi,
I have run the following php scripts to delete the Test Orders,
require 'app/Mage.php'; Mage::app('admin')->setUseSessionInUrl(false); $orderIds=array( '500000062', ); foreach($orderIds as $id){ try{ Mage::getModel('sales/order')->loadByIncrementId($id)->delete(); echo "Deleted"; }catch(Exception $e){ echo $e->getMessage(); } }
I checked this code at my localhost and it was working fine. At Server, the record is deleted, but still persists on the sales order grid view. When I am clicking the record, given me the error message 'the record no longer exists '.
I want to remove deleted order records from the grid view, also want to know why the code works fine at localhost not server.
I hope someone will help me on this.
Thanks,
Gayathri S
Solved! Go to Solution.
If you have deleted the order, but it is still seen in the Orders Grid (even after you have refreshed the cache), the problem might be caused by the foreign key. The foreign key in the sales_flat_order_grid may not be working.
Delete the record from there as well, and tell us if it helped.
If you have deleted the order, but it is still seen in the Orders Grid (even after you have refreshed the cache), the problem might be caused by the foreign key. The foreign key in the sales_flat_order_grid may not be working.
Delete the record from there as well, and tell us if it helped.
Thanks for the Reply..
It's working now. I got to know why its working in localhost.
Also clearly understand the magento orders table.
Did you tried running the indexer from shell?
I was able to fix a similar issue with Customers grid but I'm not sure if Sales grid can be reindexed.