New answers tagged schedulebatch
1
I can think of a couple of approaches
1 - Store the datetime in Custom Metadata. You can do this easily by exploiting this andyinthecloud GitHub repo . I have done this in one of my applications.
You could also use a custom object.
2 - If possible, make the batch job idempotent so it can run with a filter like TODAY. If it encounters records it has already ...
3
Your problem is the aggregate query:
AggregateResult[] miAccountList=[
SELECT Account_Item_Owner__c
FROM Master_Inventory__c
WHERE CreatedDate = LAST_N_MONTHS:2
GROUP BY Account_Item_Owner__c
];
Right now, you pull 2 months of data for all accounts in your system, even though you already know which Account records you care about. The most ...
answered Feb 10 at 16:57
Top 50 recent answers are included
Related Tags
schedulebatch × 416apex × 262
batch × 216
scheduled-apex × 154
unit-test × 33
scheduled-job × 32
trigger × 24
soql × 20
callout × 19
governorlimits × 13
code-coverage × 10
future × 10
class × 9
visualforce × 8
query × 8
scheduled × 8
cron × 8
email × 7
asynchronous × 7
failing-tests × 6
rest-api × 5
api × 4
json × 4
webservices × 4
apex-email-service × 4