You need to sign in to do that
Don't have an account?

Batch Apex Class
Hello,
I have to write a batch apex class on two objects
1. Case
2. Ticket__C
Ticket__c has a lookup to case and a case can have many ticket records but a ticket can only be associated to one case record
The Batch Apex class should run every morning at 2:00am and look at two fields(Status) in both the objects. Batch Apex shouls look at all the Cases and all the Tickets associated to the cases.
Case - Status (Field)
Ticket__c - GLOBAL_Ticket_Status__c (Field)
For example : if a case is associated with 3 Ticket__c records and the status of case is open, but status on 2 ticket__c records are closed and not the third record. Do not do anything.
If status of all the Ticket__c records are set to closed for a particular Case record but the Case record status itself is still open, Close the case after 7 days of Ticket__c records status closed. (This is because if business want to add a ticket to that particular case they can just because the case status is not closed).
Any help will be much appreciated
thank you
I have to write a batch apex class on two objects
1. Case
2. Ticket__C
Ticket__c has a lookup to case and a case can have many ticket records but a ticket can only be associated to one case record
The Batch Apex class should run every morning at 2:00am and look at two fields(Status) in both the objects. Batch Apex shouls look at all the Cases and all the Tickets associated to the cases.
Case - Status (Field)
Ticket__c - GLOBAL_Ticket_Status__c (Field)
For example : if a case is associated with 3 Ticket__c records and the status of case is open, but status on 2 ticket__c records are closed and not the third record. Do not do anything.
If status of all the Ticket__c records are set to closed for a particular Case record but the Case record status itself is still open, Close the case after 7 days of Ticket__c records status closed. (This is because if business want to add a ticket to that particular case they can just because the case status is not closed).
Any help will be much appreciated
thank you
The only issue is i have never written batch apex class before and any guidence as to how to go about getting the code written is much appreciated