Salesforce Fundamentals · Topic 1 of 3
Declarative vs Programmatic Customization and AgentExchange
When clicks are enough and when code is needed on the Salesforce Platform, governor limits, and when to install an AgentExchange solution instead.
- 5 min
- Choose standard features first, then declarative tools, then AgentExchange, then code.
- Apex, LWC, Aura and Visualforce are programmatic; Flow, formulas and Lightning App Builder are declarative.
- Developers can build invocable actions and components that builders then use with clicks.
What it is
The Salesforce Platform can be customized in two ways. Declarative customization uses point-and-click tools such as Object Manager, formulas, validation rules, Flow and Lightning App Builder. Programmatic customization uses code: Apex, Lightning Web Components (LWC), Visualforce and the APIs.
An app builder's first choice is always declarative. Code is the right answer only when clicks genuinely cannot meet the requirement. A third option is to install an existing solution from AgentExchange, the Salesforce marketplace formerly called AppExchange.
How it works
Declarative and programmatic tools side by side
| Need | Declarative tool | Programmatic tool |
|---|---|---|
| Store data | Custom objects and fields | Not needed |
| Calculate a value | Formula or roll-up summary field | Apex |
| Enforce a data rule | Validation rule | Apex trigger |
| Automate a process | Flow | Apex trigger or class |
| Build a page | Lightning App Builder, Dynamic Forms | LWC, Aura, Visualforce |
| Connect to another system | Salesforce Connect, external services, flow HTTP callout | Apex callouts, APIs |
Declarative work is faster to build, easier to maintain and upgraded automatically by Salesforce releases. Code needs developers, test classes and more maintenance.
Where clicks reach their limit
Typical signs that code is needed:
- A user interface that no standard component, Dynamic Form or screen flow component can produce, such as a drag-and-drop scheduling grid.
- Complex logic across many records that a flow cannot handle efficiently, or that needs features flows do not offer.
- Integrations that need custom request handling, complex authentication or a custom web service exposed from Salesforce.
- Processing very large data volumes in batches.
Often the best answer mixes both: a developer writes an invocable Apex action or a Lightning web component, and the app builder uses it in a flow or on a Lightning page with clicks.
Governor limits
Salesforce is multitenant, so every transaction has governor limits, such as the number of database queries and record changes. Flows and Apex that run in the same transaction share those limits. Building efficient automation, for example not querying or updating records inside a loop, matters for clicks and code alike.
AgentExchange use cases
AgentExchange lists apps, Lightning components, flow solutions, agent actions and consultants. Installing a solution makes sense when:
- The requirement is common across companies, such as e-signature, document generation or connecting to a well-known system.
- Building it would take longer or cost more than the listed product.
- The team has no developers but needs functionality that only code could provide.
Most listed apps are installed as managed packages. Their code is hidden and protected, their components carry the publisher's namespace prefix, and the publisher can push upgrades. You can usually add your own fields and automation around them, but you cannot edit the packaged code.
Evaluating a listing
| Check | Why it matters |
|---|---|
| Reviews and ratings | Show how the product works for other customers |
| Security review | Listed apps go through a Salesforce security review before listing |
| Where data is stored | Some apps send data to the publisher's own servers |
| Editions and licenses | The app may need a particular Salesforce edition |
| Test drive or trial | Lets you try before installing |
Install into a sandbox first, test it, then install into production. During installation you choose whether to install for admins only, all users or specific profiles.
A worked example: a recruiting team wants candidates to sign offer letters electronically. Building signature capture and a legally valid audit trail would need developers and a lot of time. An e-signature app on AgentExchange already does this, so the builder installs it in a sandbox, checks where documents are stored, tests it, and then installs it in production for the recruiting profiles.
When an exam answer list includes both a declarative option and Apex that would both work, the declarative option is almost always correct.
How the exam asks about this
- "No developer, and the field must calculate automatically." A formula field.
- "A UI that no standard component provides." A Lightning web component built by a developer.
- "A common need that a listed product already solves." Install from AgentExchange.
What to remember for the exam
- Choose standard features first, then declarative tools, then AgentExchange, then code.
- Apex, LWC, Aura and Visualforce are programmatic; Flow, formulas and Lightning App Builder are declarative.
- Developers can build invocable actions and components that builders then use with clicks.
- Governor limits apply to every transaction, and automation in the same transaction shares them.
- Managed packages from AgentExchange have a namespace, hidden code and an upgrade path.
An AgentExchange app may store your data outside Salesforce. Check where data goes before installing when compliance rules apply.
Common mistakes
Choosing Apex because it can do more. If a declarative tool meets the requirement, it is the expected answer.
Assuming you can edit a managed package's code. You can build around it, but not change its protected components.
Installing straight into production. Test in a sandbox first.
Check yourself
A requirement can be met with a flow or an Apex trigger. Which should the app builder choose?
The flow, because declarative tools are preferred whenever they meet the requirement.
What does a namespace prefix on a component tell you?
That the component came from a managed package published under that namespace.
When is installing from AgentExchange better than building?
When a listed solution already meets a common requirement faster or more cheaply than building it, especially without developers.
Topic 1 of 3 in Salesforce Fundamentals
Test yourself on Salesforce Fundamentals
The full Salesforce Platform App Builder question bank has 648 questions, with timed practice exams and an explanation for every answer.
This study guide is independent and is not affiliated with, endorsed by, or sponsored by Salesforce. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.