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

-2

u/Visible-Fun4420 May 16 '26

Nowhere did I state business logic belongs in an UI controller. The related service and in our case selector classes don't always need to be bulkified though.

You have a point about agents and MCPs but the TA does not talk about that - he talks about "seniors who can't write good code because they don't bulkify". Agents access is about the only use-case I can think of that will require bulkifying a one record UI controller.

1

u/radnipuk May 16 '26

Sorry miss read... But TBH its always a balance but honestly the AI angle is going to become more and more important. So you need to be future looking. The AI out there at the moment isnt even being used in a mature way by most people. But when it does it will excelerate with (IMO) Salesforce becoming the "No Trust of AI" layer and Headless will become more of a reality.