Skip to content

Magento2 update custom column value in sales order grid table

Magento2 I have added custom column in sales_order. I am updating its value via CRON but how can I use same value in sales_order_grid

Below code is use to update sales_order

 $order = $this->orderRepository->get($order->getId()); //1 is your order ID
                $order->setCustomValue(2);
                $this->orderResourceModel->save($order);

Please guide to update grid value as well