You need to sign in to do that
Don't have an account?
Waqas Ali
Get all the records within the last 24-hour according to LastModifiedDate
I want to get all the records within the last 24-hour according to LastModifiedDate , Here is what I am doing
global class SalesOrderSchedule implements Schedulable { global static String CRON_EXP = '0 0 0 ? *'; global void execute(SchedulableContext sc) { doOpportunityUpdates(); } global void doOpportunityUpdates() { List<Opportunity> opps = new List<Opportunity>(); DateTime dt_lastDay = System.now()-1; DateTime dt_currentDay = System.now(); for(Sales_Order__c salesorder : [select id, Name, LastModifiedDate from Sales_Order__c WHERE LastModifiedDate > = :dt_lastDay AND LastModifiedDate < :dt_currentDay ] ) { //my functionality } }but this query is not working, Guys help
Please change your code with the below code: Let me know if there is any issue.
Thanks,
Abhishek