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
ab84ab84 

Batch apex to update account based on contract status

Hi all,

I've done some basic classes but I've never written a batch class before.  

What I need is a class that I can schedule daily.  This will go through all accounts.  It will check the service contracts on the account.  If there is an active contract for Product A (a record type) then the "Product_A_Valid__c" box on the account object can be checked.  If there is no active product A contract then it should be unchecked.

Can anyone help me with this?
Ravi Dutt SharmaRavi Dutt Sharma
How to classify a Contract as a service contract? Do you have a picklist on contract which specifies the contract type?

Thanks,
Ravi