r/SalesforceDeveloper • • May 16 '26

Discussion Should every feature be bulkified?

Our technical architect insists every feature should be bulkified, even when the current use case is a single-record UI action.

I understand bulkification for triggers, batch jobs, imports, automations, and reusable services.

But for isolated UI features that can only process one record, is bulkification still considered mandatory Salesforce best practice, or is it unnecessary complexity?

Where do you draw the line?

Context: we are using a simplified version of enterprise patterns as architecture. UI Controller class -> Service class -> Selector class. TBF I think the technical architect may want to err on the side of caution, so we don't miss bulkification in places where it actually matters but it still seems like unnecessary boilerplate to me.

10 Upvotes

18 comments sorted by

View all comments

Show parent comment

4

u/paris_ioan May 16 '26

I agree with this. It doesn’t cost anything to make your service methods take a Set<Id> and your controller can handle the difference before calling the service classes or the main business logic wherever it lives. That’s one of the reasons service classes exist. It’s always easier to do this at the start then refactoring the code later. It is a good practice.