+ 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