function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Baba GBaba G 

How to delete records of orderline inserted today?

ManojjenaManojjena
Hi Baba,
You can execute below code either in developer console or in workbench .

Delete [SELECT Id FROM OrderItem WHERE CreatedDate = Today];
sandeep sankhlasandeep sankhla
Hi Baba G,

Do you want to delete OrderItem or OrderLineItem ?

based on the object you can replace the object name  and execute below code from developer console

List<Orderitem> lstOItem = new list<orderItem>();

lstOItem = [Select Id from OrderItem where CreatedDate = today()];

if(!lstOItem .isEmpty())
     delete lstOItem ;

P.S. If my answer helps you to solve your problem please mark it as best answer. It will help other to find best answer.

Thanks,
Sandeep
Salesforce Certified Developer