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
Prakhyat sapraPrakhyat sapra 

write a batch class in which the contacts of all the accounts should be only 2.if more than 2 then it bocomes 2, or if less then it becomes2???????

write a batch class in which the contacts of all the accounts should be only 2.if more than 2 then it bocomes 2, or if less then it becomes2???????
PriyaPriya (Salesforce Developers) 

Hey Prakhyat,

If any account, lets say, has 5 contacts, then do you want to delete the 3 contacts?
If any account dont have any contact or only 1 contact then ?

Thanks & Regards,

Priya Ranjan

Prakhyat sapraPrakhyat sapra
Hii,
in this condition if i have the 5 contacts in the an account then i have to create more account for rest 3 contact.  if any account doesn't have any contact then create the new 2 contact in that account....