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
himanshu huske 7himanshu huske 7 

Batch Apex Scenerio

i have objects Patient__c, Doctor__c, Appointment__c, Medications__c.
Appointment__c has field patient__c(lookup), doctor__c(lookup), AppointMentDate__c(Date)
Medications__c has field patient__c(lookup), doctor__c(lookup), description__c, NextVisit__c(date).
Patient__c has an Email__c field.
if medication record is created with NextVisit != Null, 
it should send email before 2 days To get Appointment.
if appointment is made before NextVisit__c date, email should not get sent.
GovindarajGovindaraj
Hi Himanshu,

Why do we need to go for batch class for this ?

We could solve this using process builder or workflow.

Thanks,
Govindaraj.S