Learn Developer Fundamentals (PD1) with Interactive Flashcards

Master key concepts in Developer Fundamentals through our interactive flashcard system. Click on each card to reveal detailed explanations and enhance your understanding.

Multi-Tenant Architecture

Multi-Tenant Architecture is a fundamental design principle of the Salesforce platform where a single instance of the software and its underlying infrastructure serves multiple customers, known as tenants. Each tenant shares the same codebase, database, and computing resources, but their data and configurations remain logically isolated and secure from one another.

In Salesforce's multi-tenant environment, all organizations (orgs) run on the same servers, share the same database schema, and use the same version of the application. This is analogous to an apartment building where multiple tenants share the same building infrastructure (plumbing, electricity, foundation) but each has their own private, secure living space.

Key characteristics of Multi-Tenant Architecture include:

1. **Shared Resources**: All tenants share compute power, storage, and core platform services, which allows Salesforce to deliver cost-effective solutions through economies of scale.

2. **Data Isolation**: Despite sharing infrastructure, each tenant's data is logically separated using unique organization IDs, ensuring that one tenant cannot access another's data.

3. **Governor Limits**: To ensure fair resource distribution and prevent any single tenant from monopolizing shared resources, Salesforce enforces governor limits. These limits restrict things like SOQL queries, DML statements, CPU time, and heap size per transaction.

4. **Automatic Upgrades**: Since all tenants share the same codebase, Salesforce can roll out three seamless upgrades per year to everyone simultaneously without disrupting individual customizations.

5. **Metadata-Driven Development**: Customizations are stored as metadata rather than modifying the core application code. This allows each tenant to have unique configurations while maintaining platform stability.

For Platform Developer I candidates, understanding multi-tenancy is crucial because it directly impacts how code should be written. Developers must write efficient, bulkified code that respects governor limits, uses collections instead of single-record processing, and avoids excessive resource consumption. This ensures applications perform well within the shared environment and coexist harmoniously with other tenants on the platform.

Governor Limits Overview

Governor Limits in Salesforce are runtime limits enforced by the Apex runtime engine to ensure that no single tenant monopolizes shared resources in Salesforce's multi-tenant cloud environment. Since multiple organizations share the same infrastructure, these limits prevent runaway code from consuming excessive CPU, memory, database, or network resources.

**Key Governor Limits Include:**

1. **SOQL Queries:** A maximum of 100 SOQL queries per synchronous transaction and 200 per asynchronous transaction. This prevents excessive database calls.

2. **DML Statements:** Limited to 150 DML statements per transaction (insert, update, delete, undelete, merge, upsert).

3. **SOQL Query Rows:** A maximum of 50,000 rows can be retrieved by SOQL queries per transaction.

4. **DML Rows:** Up to 10,000 records can be processed by DML statements per transaction.

5. **CPU Time Limit:** 10,000 milliseconds for synchronous transactions and 60,000 milliseconds for asynchronous transactions.

6. **Heap Size:** 6 MB for synchronous and 12 MB for asynchronous transactions.

7. **Callouts:** A maximum of 100 HTTP callouts per transaction with a 120-second total timeout.

8. **Future Methods:** Limited to 50 future method invocations per transaction.

**Best Practices to Avoid Hitting Limits:**

- **Bulkify Code:** Always write code that handles collections of records rather than single records. Use collections in SOQL queries and DML operations.
- **Avoid SOQL/DML in Loops:** Never place queries or DML statements inside for loops.
- **Use Collections:** Leverage Lists, Sets, and Maps to efficiently process data.
- **Use Limits Class:** The `Limits` class methods (e.g., `Limits.getQueries()`, `Limits.getLimitQueries()`) help monitor consumption at runtime.

Violating governor limits results in a runtime exception that cannot be handled, causing the entire transaction to roll back. Understanding and respecting these limits is fundamental for every Salesforce developer and is a critical topic for the Platform Developer I certification exam.

MVC Design Pattern on Salesforce

The Model-View-Controller (MVC) design pattern is a fundamental architectural concept in Salesforce development that separates an application into three interconnected components, promoting organized, maintainable, and scalable code.

**Model (Data Layer):**
In Salesforce, the Model represents the data and business logic. This includes Standard Objects (Account, Contact, Opportunity), Custom Objects, Fields, Relationships, and the underlying database schema. Apex classes that handle data operations, SOQL/SOSL queries, and business logic also form part of the Model. Essentially, anything that defines how data is stored, validated, and manipulated falls under this layer. Validation rules, workflow rules, and trigger logic are also considered part of the Model.

**View (Presentation Layer):**
The View is responsible for the user interface — what users see and interact with. In Salesforce, this includes Visualforce Pages, Lightning Components (both Aura and Lightning Web Components), Page Layouts, Record Types, and Lightning App Pages. The View renders data from the Model and sends user interactions back to the Controller. It should contain minimal business logic and focus purely on presentation.

**Controller (Logic Layer):**
The Controller acts as the intermediary between the Model and the View. It processes user input from the View, interacts with the Model to retrieve or manipulate data, and returns results back to the View. In Salesforce, Controllers include Standard Controllers (built-in functionality for standard CRUD operations), Custom Controllers (Apex classes that define custom logic entirely), and Controller Extensions (Apex classes that extend standard or custom controller functionality). JavaScript controllers in Lightning Components also serve this role.

**Benefits in Salesforce:**
- **Separation of Concerns:** Each layer has a distinct responsibility, making code easier to debug and maintain.
- **Reusability:** Components can be reused across different parts of the application.
- **Testability:** Business logic in the Controller and Model can be unit tested independently.
- **Collaboration:** Developers and designers can work simultaneously on different layers.

Understanding MVC is essential for the Platform Developer I exam as it forms the backbone of Salesforce application architecture and guides best practices in development.

Lightning Component Framework Overview

The Lightning Component Framework is a modern UI framework designed for building dynamic, responsive single-page applications for both mobile and desktop devices on the Salesforce platform. It is a core part of the Salesforce development ecosystem and is essential knowledge for the Platform Developer I certification.

The framework operates on a component-based architecture, where reusable, self-contained components serve as the building blocks of applications. Each component encapsulates its own markup, JavaScript logic, styling, and controller logic, promoting modularity and reusability.

There are two primary programming models within the Lightning Component Framework:

1. **Lightning Web Components (LWC):** The newer, standards-based model built on modern web standards such as Web Components, Shadow DOM, custom elements, and ES modules. LWC is lightweight, performant, and leverages native browser capabilities, making it the recommended approach for new development.

2. **Aura Components:** The original model that uses a proprietary framework. While still supported, Salesforce encourages developers to adopt LWC for new projects. Aura components can coexist with LWC, allowing interoperability between the two models.

Key concepts of the framework include:

- **Event-Driven Architecture:** Components communicate through events, enabling loose coupling between components. Events can be component-level, application-level, or standard DOM events.
- **Data Binding:** The framework supports reactive data binding, where changes to data automatically reflect in the UI.
- **Server-Side Integration:** Components interact with Salesforce data using Apex controllers via the @AuraEnabled annotation, enabling seamless server-side communication.
- **Security:** The framework enforces Lightning Locker Service (for Aura) and Lightning Web Security (for LWC) to provide component isolation and prevent cross-site scripting attacks.
- **Base Components:** Salesforce provides a rich library of pre-built base components (e.g., lightning-input, lightning-datatable) that accelerate development.

The Lightning Component Framework powers Lightning Experience, Salesforce Mobile App, and custom Lightning apps. Understanding this framework is fundamental for Platform Developer I candidates, as it represents Salesforce's primary approach to building modern, scalable user interfaces.

Declarative vs Programmatic Customizations

In Salesforce development, customizations fall into two categories: Declarative and Programmatic. Understanding the distinction is fundamental for the Platform Developer I certification.

**Declarative Customizations (Point-and-Click):**
These are configurations made through the Salesforce UI without writing code. They leverage built-in tools and are generally preferred as they are easier to maintain, automatically upgraded by Salesforce, and require less testing. Key declarative tools include:

- **Objects & Fields:** Creating custom objects, fields, and relationships through Schema Builder or Setup.
- **Validation Rules:** Enforcing data quality using formula-based rules.
- **Flows:** Automating business processes using Flow Builder (Screen Flows, Record-Triggered Flows, Autolaunched Flows).
- **Approval Processes:** Managing multi-step approval workflows.
- **Page Layouts & Record Types:** Controlling UI presentation and business process variations.
- **Reports & Dashboards:** Building analytics without code.
- **Permission Sets & Profiles:** Managing security and access declaratively.

**Programmatic Customizations (Code-Based):**
These require writing code and are used when declarative tools cannot meet complex requirements. Key programmatic tools include:

- **Apex:** Salesforce's proprietary Java-like language for triggers, classes, batch processing, and web services.
- **Lightning Web Components (LWC):** Modern JavaScript-based framework for building custom UI components.
- **Aura Components:** The predecessor to LWC for custom UI development.
- **SOQL/SOSL:** Query languages for retrieving Salesforce data.
- **Visualforce:** Legacy markup language for custom pages.

**Best Practice - Declarative First:**
Salesforce strongly recommends a 'declarative-first' approach. Always evaluate if a requirement can be solved with clicks before writing code. This reduces technical debt, simplifies maintenance, and ensures better platform compatibility during upgrades.

**When to Use Programmatic:**
Choose code when you need complex business logic, custom UI experiences, integration with external systems, operations requiring transaction control, or functionality that exceeds declarative tool capabilities.

For the PD1 exam, understanding when to use each approach and their respective governor limits and best practices is essential.

Formula Fields and Validation Rules

Formula Fields and Validation Rules are two powerful declarative features in Salesforce that allow developers and administrators to implement business logic without writing Apex code.

**Formula Fields** are read-only fields that automatically calculate their values based on expressions you define. They can reference other fields, use operators, and leverage built-in functions. Formula fields are evaluated in real-time whenever a record is viewed. Key characteristics include:

- They support various return types: Text, Number, Date, DateTime, Currency, Percent, and Checkbox.
- They can reference fields from related objects using cross-object formulas (up to 10 relationships).
- They have a compile size limit of 5,000 characters and cannot exceed the formula field limit per object.
- Common functions include IF(), CASE(), ISBLANK(), TEXT(), TODAY(), NOW(), and VLOOKUP().
- They are calculated dynamically and are not stored in the database (except in reporting indexes).
- Example: A formula field calculating total price as Quantity__c * Unit_Price__c.

**Validation Rules** enforce data quality by preventing users from saving records that don't meet specified criteria. They evaluate an expression that returns TRUE or FALSE — when TRUE, the record is rejected and an error message is displayed. Key characteristics include:

- They fire when a record is created or updated via any method (UI, API, Apex, etc.).
- Error messages can be displayed at the top of the page or next to a specific field.
- They can reference fields on the current object and related parent objects.
- They support the same functions available in formula fields.
- They execute after before-triggers in the order of execution.
- Example: A rule ensuring a Close Date is not in the past: CloseDate < TODAY().

Both features are essential for the Platform Developer I exam. Understanding their capabilities, limitations, and how they fit into the Salesforce order of execution is critical. They represent best-practice declarative solutions that should be used before resorting to programmatic approaches like Apex triggers.

Roll-Up Summary Fields

Roll-Up Summary Fields are a powerful feature in Salesforce that allow you to calculate values from related child records and display them on a parent (master) record in a Master-Detail relationship. They perform aggregate calculations such as COUNT, SUM, MIN, and MAX on child records, automatically updating whenever child records are created, updated, or deleted.

**Key Characteristics:**

1. **Relationship Requirement:** Roll-Up Summary Fields can only be created on the master object in a Master-Detail relationship. They cannot be used with Lookup relationships natively.

2. **Supported Functions:**
- **COUNT:** Counts the total number of related child records.
- **SUM:** Calculates the total sum of a numeric field on child records.
- **MIN:** Identifies the minimum value from a field on child records.
- **MAX:** Identifies the maximum value from a field on child records.

3. **Filter Criteria:** You can optionally define filter criteria to include only specific child records in the calculation. For example, summing only opportunities with a 'Closed Won' stage.

4. **Real-Time Updates:** Roll-Up Summary Fields are recalculated automatically whenever child records change, ensuring data accuracy without manual intervention.

5. **Limitations:**
- Limited to Master-Detail relationships (not Lookup relationships).
- There is a limit of 25 Roll-Up Summary Fields per object.
- Certain field types like formula fields or long text fields cannot be summarized.
- Cross-object formula fields are not supported in roll-up calculations.

**Use Cases:**
- Displaying the total amount of all related Opportunities on an Account.
- Showing the count of related Cases on a parent record.
- Finding the earliest or latest date among child records.

**Developer Considerations:**
For scenarios where Roll-Up Summary Fields are not available (e.g., Lookup relationships), developers can use Apex Triggers or declarative tools like Salesforce Flow to replicate roll-up functionality. Additionally, the Declarative Lookup Rollup Summaries (DLRS) open-source tool is a popular alternative.

Understanding Roll-Up Summary Fields is essential for the Platform Developer I exam, as they represent a key declarative tool for data aggregation in Salesforce.

Standard and Custom Objects

In Salesforce, objects are fundamental building blocks that store data, similar to tables in a relational database. They are central to the Salesforce data model and come in two primary types: Standard Objects and Custom Objects.

**Standard Objects** are pre-built objects provided out-of-the-box by Salesforce. These include commonly used business entities such as Account, Contact, Opportunity, Lead, Case, and Campaign. Standard objects come with predefined fields, relationships, and built-in business logic tailored to common CRM processes. They are maintained and updated by Salesforce with each release. Developers can extend standard objects by adding custom fields, validation rules, triggers, and workflows, but they cannot delete standard objects or their core standard fields.

**Custom Objects** are user-defined objects created to store data specific to an organization's unique business requirements. Custom objects are identified by the '__c' suffix in their API name (e.g., Invoice__c). They support all the features available to standard objects, including custom fields, page layouts, relationships, triggers, validation rules, and workflow rules. Developers can create custom objects via the Setup UI, Metadata API, or within a development environment.

Both standard and custom objects support various field types such as text, number, date, picklist, lookup, and master-detail relationships. Relationships between objects (lookup and master-detail) enable data modeling that reflects real-world business associations.

From a developer perspective, both object types are accessible through SOQL (Salesforce Object Query Language), SOSL (Salesforce Object Search Language), DML operations, Apex code, and APIs. Understanding how to work with both types is essential for the Platform Developer I exam, as questions often test knowledge of object creation, field types, relationships, data access patterns, and governor limits.

In summary, standard objects provide a strong CRM foundation, while custom objects offer the flexibility to extend the platform to meet any business need, making Salesforce a highly customizable and powerful development platform.

Master-Detail vs Lookup Relationships

In Salesforce, Master-Detail and Lookup are two primary types of object relationships, each serving distinct purposes.

**Master-Detail Relationship:**
This is a tightly coupled parent-child relationship where the master (parent) record controls the behavior of the detail (child) record. Key characteristics include:

1. **Ownership & Security:** The detail record inherits its Owner, sharing settings, and security from the master record. You cannot set independent sharing rules on the detail object.
2. **Cascade Delete:** When a master record is deleted, all related detail records are automatically deleted (cascade delete).
3. **Required Field:** The relationship field on the detail record is always required — a detail record cannot exist without a parent.
4. **Roll-Up Summary Fields:** Master-Detail relationships allow you to create roll-up summary fields on the master object to aggregate data (SUM, COUNT, MIN, MAX) from detail records.
5. **Reparenting:** By default, you cannot change the master record once set, unless you enable the 'Allow Reparenting' option.
6. **Limits:** An object can have up to two master-detail relationships.

**Lookup Relationship:**
This is a loosely coupled relationship that simply links two objects together without strict dependency. Key characteristics include:

1. **Independence:** The child record exists independently. Deleting the parent does not automatically delete the child (unless cascade delete is configured).
2. **Optional Field:** The lookup field is not required by default — records can exist without a parent reference.
3. **No Roll-Up Summary:** Standard roll-up summary fields are not natively supported (though you can use tools like Declarative Lookup Rollup Summaries or Flow).
4. **Independent Security:** Each object maintains its own sharing and security settings.
5. **Reparenting:** You can freely change the parent record at any time.
6. **Limits:** An object can have up to 40 lookup relationships.

**When to Use:**
Use Master-Detail when the child record has no meaning without the parent and you need roll-up summaries. Use Lookup when objects are related but independent, and the relationship is optional. Understanding these differences is critical for proper data modeling on the Salesforce platform.

Many-to-Many Relationships and Junction Objects

In Salesforce, a Many-to-Many (M:M) relationship exists when multiple records of one object can be associated with multiple records of another object. For example, a Student can enroll in many Courses, and a Course can have many Students. Salesforce does not provide a direct many-to-many relationship type, so developers implement this pattern using a Junction Object.

A Junction Object is a custom object that sits between two other objects and contains two Master-Detail relationship fields, each pointing to one of the parent objects. This effectively creates two one-to-many relationships that together represent a many-to-many relationship.

For example, to model Students and Courses:
1. Create a custom object called 'Enrollment__c' (the Junction Object).
2. Add a Master-Detail field on Enrollment__c pointing to Student__c (first master).
3. Add a second Master-Detail field on Enrollment__c pointing to Course__c (second master).

Key characteristics of Junction Objects:
- The first Master-Detail relationship determines the junction object's record owner, sharing rules, and the look-and-feel of the detail page.
- The second Master-Detail relationship does not affect ownership or sharing.
- Both related lists automatically appear on the parent objects' page layouts.
- Junction object records are deleted when either parent record is deleted.
- Roll-up summary fields can be created on both parent objects to aggregate data from the junction object.
- The junction object can also contain additional custom fields to store relationship-specific data (e.g., enrollment date, grade).

On the Salesforce Platform Developer I exam, understanding junction objects is critical because they are the standard approach for modeling many-to-many relationships. Developers should know that the junction object must have exactly two Master-Detail fields, and the order in which these fields are created matters for ownership and page layout behavior. Junction objects are also important when writing SOQL queries, as they enable querying across both parent relationships using relationship queries and subqueries.

External IDs and External Relationships

External IDs and External Relationships are important concepts in Salesforce development that facilitate data integration and management between Salesforce and external systems.

**External IDs:**
An External ID is a custom field in Salesforce that contains unique record identifiers from an external system (such as an ERP, legacy database, or third-party application). You can mark certain field types as External IDs, including Text, Number, Email, and Auto Number fields. Each object can have up to 25 External ID fields. Key characteristics include:

- They are automatically indexed, improving query performance when searching by these fields.
- They are used during data import operations (such as Upsert) to match existing records, preventing duplicates.
- During an upsert operation, Salesforce uses the External ID to determine whether to insert a new record or update an existing one.
- They serve as a bridge between Salesforce and external systems, maintaining referential integrity across platforms.

**External Relationships:**
External Relationships (also called External Lookup Relationships) are a type of relationship field that links a Salesforce object to an External Object. External Objects represent data stored outside Salesforce, typically accessed via Salesforce Connect and OData protocols. There are three types of relationships involving external data:

1. **External Lookup Relationship** - Links a standard, custom, or external object to an external object. The relationship is identified by the external object's standard External ID field.

2. **Indirect Lookup Relationship** - Links an external object to a standard or custom Salesforce object. Instead of using the Salesforce record ID, it matches an External ID field on the parent object with the External Column Name on the external object.

3. **Lookup Relationship** - Links an external object to a parent object using the standard Salesforce 18-character ID.

These mechanisms are essential for Salesforce developers working on integration scenarios, enabling seamless data synchronization, preventing duplicate records, and maintaining relationships between internal Salesforce data and external system data without physically storing all data within Salesforce.

Data Import and Export Tools

Salesforce provides several powerful tools for importing and exporting data, which are essential for developers and administrators to manage data effectively.

**Data Import Tools:**

1. **Data Import Wizard**: A built-in Salesforce tool accessible through Setup. It supports importing data for standard objects like Accounts, Contacts, Leads, Solutions, and custom objects. It handles up to 50,000 records at a time, supports CSV files, and provides duplicate management through matching rules. It is browser-based and doesn't require installation.

2. **Data Loader**: A client-side application that supports both import and export operations. It can handle up to 5 million records and supports operations like Insert, Update, Upsert, Delete, Hard Delete, and Export. Data Loader can be operated through a GUI or command-line interface (CLI), making it suitable for automation and scheduled batch processes. It uses CSV files and supports the Bulk API for large data volumes.

**Data Export Tools:**

1. **Data Export Service**: A built-in Salesforce feature accessible through Setup that allows scheduled or manual exports of all org data. It generates a set of CSV files that can be downloaded as a ZIP archive. Export intervals depend on your edition (weekly or monthly).

2. **Data Loader (Export)**: As mentioned, Data Loader also supports exporting data using either the standard SOAP API or Bulk API. Developers can write custom SOQL queries to export specific datasets.

3. **Reports**: While primarily an analytics tool, reports can export filtered data to CSV or Excel formats.

**Key Considerations for Developers:**
- Understanding API limits and governor limits when handling large data volumes
- Using External IDs for upsert operations to maintain relationships between objects
- Handling field mapping correctly during imports
- Managing lookup relationships and master-detail dependencies during data loading
- Using the Bulk API for operations exceeding 50,000 records to optimize performance

Choosing the right tool depends on data volume, complexity, automation needs, and whether the operation is a one-time or recurring process.

Agentforce for Developers

Agentforce for Developers is a significant topic within the Salesforce Certified Platform Developer I exam and Developer Fundamentals curriculum, focusing on how developers can leverage Salesforce's AI-powered agent capabilities to build intelligent, autonomous applications.

Agentforce represents Salesforce's evolution in AI-driven development, enabling developers to create autonomous AI agents that can perform tasks, make decisions, and interact with users naturally. These agents operate within the Salesforce platform and can be customized using declarative and programmatic tools.

Key concepts for developers include:

**Agent Actions**: Developers can define custom actions that agents can execute. These actions are built using Apex classes, flows, or invocable methods, allowing agents to perform complex business logic, query data, update records, and interact with external systems.

**Topics and Instructions**: Developers configure topics that define the scope of an agent's capabilities. Each topic contains natural language instructions that guide the agent's behavior, along with mapped actions the agent can invoke.

**Apex Integration**: Developers write Apex classes with @InvocableMethod annotations to create custom agent actions. These methods define inputs and outputs that the agent can understand and utilize during conversations.

**Prompt Templates**: Developers can create and customize prompt templates that shape how agents interpret user requests and generate responses. These templates support grounding with CRM data for contextual accuracy.

**Testing and Debugging**: The platform provides tools for developers to test agent behaviors, review conversation logs, and debug action execution to ensure agents perform reliably.

**Trust and Governance**: Agentforce operates within Salesforce's Trust Layer, ensuring data security, preventing hallucinations, and maintaining compliance. Developers must understand guardrails like data masking and toxicity detection.

**GenAI Features in Apex**: Salesforce provides native Apex classes for working with large language models, semantic search, and embeddings, enabling developers to build sophisticated AI-powered functionality.

For the Platform Developer I certification, understanding how to programmatically extend Agentforce through Apex, configure agent actions, and integrate AI capabilities within the Salesforce ecosystem is essential for modern development practices.

More Developer Fundamentals questions
650 questions (total)