Answers for "schedulable class example in salesforce"

0

schedulable class example in salesforce

global class SAPOrdersDeleteScheduler implements Schedulable {
global void execute(SchedulableContext sc){
List cldOrders = [select Id from SAPOrder__c where Status__c ='Closed'];
List cldOrderItems=[select Id from SAP_Order_Item__c where SAPOrder__c in:cldOrders];
if(!cldOrderItems.isEmpty())
{
delete cldOrderItems;
}
if(!cldOrders.isEmpty())
{
delete cldOrders;
}
}
}
Posted by: Guest on August-20-2021

Code answers related to "schedulable class example in salesforce"

Browse Popular Code Answers by Language