Let’s say you have a list of Accounts and you want to populate their birthday with the same date. However, you also want this method to be reusable.
What is the best way to do this in APEX?
So far I’ve been creating a void method that takes in a list of objects and simply updates them as needed but this feels too procedural, i.e when I do this:
I’d rather do something like this, but not sure if it’s over engineered:
AccountsHandler accounts = new AccountsHandler(accountRecords); // custom class to handle account processing accounts.setBirthday(birthDate);
I am interested in hearing the best practice way of doing this in general and whether I overlooked other options.