You need to sign in to do that
Don't have an account?
Batch apex
i have appointment and accounts objects, both got 2 similar fields email and tax, if appoinment getting insert with the same email and tax of account record, then update appointment acc__c with account id.
how to implement in batch apex.
is my code written is correct?
global class updaterecords implements Schedulable
{
public updaterecords()
{
}
/* to excute the fields */
/*
global void execute(SchedulableContext ctx)
{
appointment []app=[select email,tax from appointment where CreatedDate = TODAY ];
account []accts=[select email, tax_acc from account];
for(appointment s:app)
{
for(account a:accts)
{
if(a.email==s.email|| a.tax_acc==s.tax)
{
s.acct__c= a.ID;
}
}
}
update app;
}
}
Woop's!!
All Answers
Hello there, You talking about a Batch classs then,
Woop's!!
Thank you, for the solution.