Salesforce Technical Architect Questions

Preparing for a Salesforce Technical Architect interview involves a deep understanding of Salesforce’s platform, architecture, and best practices. Here’s a broad set of questions divided into different categories relevant to a Salesforce Technical Architect: General Understanding & Conceptual Knowledge Salesforce Products and Features Design and Implementation Data Management Integration and Middleware Performance Optimization Testing andContinue reading “Salesforce Technical Architect Questions”

How would you handle bulk data operations in Salesforce?

Handling bulk data operations in Salesforce efficiently is crucial for maintaining performance and staying within platform limits. Here are several strategies and tools that can be used: 1. Use of Bulk API 2. Batch Apex 3. Data Loader 4. Optimizing Data Operations 5. Using Platform Events and Change Data Capture 6. Parallel Processing 7. MonitoringContinue reading “How would you handle bulk data operations in Salesforce?”

Error Logging Mechanism in Salesforce

We must handle error properly while writing a piece of logic in Salesforce. In case of error, we can capture error logs and throw error as well. Problem: If we try to insert logger before throwing error, logger record is not created because its roll backed because of exception throwing even if we use futureContinue reading “Error Logging Mechanism in Salesforce”

How to get key-prefix of salesforce object?

Sometimes while writing your code in trigger, you need to identify objects based on record id of the record. So, first three character of the recordId which is called key-prefix is used to identify object in code. For eg. a0u is the keyprefix which is used to identify Custom_Network_Case__c object as shown in below urlContinue reading “How to get key-prefix of salesforce object?”

How to delete all debug logs in Salesforce

Problem: By default, there is no feature in salesforce we can delete all debug logs on single click of a button. As you can see in below screenshot, you have ‘Delete All’ button but when click on this button, it deletes only a bunch of logs. Solution: You need to run below command in javascriptContinue reading “How to delete all debug logs in Salesforce”

Bulk State Transition (Apex Design Patterns)

What is Bulk State Transition?: This pattern is used to perform bulk actions efficiently based on change of state of one or more records. Why Bulk State Transition?: We generally creates a utility to process bulk records here. Same utility can be used anywhere irrespective of triggers. Problem: We will taking an example of orderContinue reading “Bulk State Transition (Apex Design Patterns)”

Composite Design Pattern (Apex Design Patterns)

What is Composite Design Pattern?: Composite is a structural design pattern that lets you compose objects into tree structures and then work with these structures as if they were individual objects. Composite design pattern treats each node in two ways:1) Composite – Composite means it can have other objects below it.2) leaf – leaf means it has no objects below it.Continue reading “Composite Design Pattern (Apex Design Patterns)”

Facade Design Pattern (Apex Design Patterns)

What is Facade Pattern?: This is a structure design pattern which hides the complexity of the system and provides simple interface to the client. This pattern involves a class called as Facade which provides simplified methods required by clients and delegates its call to methods of existing classes. Why Facade?: There may be many complexContinue reading “Facade Design Pattern (Apex Design Patterns)”

Decorator Design Pattern (Apex Design Patterns)

What is Decorator Pattern?: Decorator pattern allows a user to add new functionality to an existing object without altering its structure. This type of design pattern comes under structural pattern as this pattern acts as a wrapper to existing class. This pattern creates a decorator class which wraps the original class and provides additional functionalityContinue reading “Decorator Design Pattern (Apex Design Patterns)”

Strategy Design Pattern (Apex Design Patterns)

What is Strategy Pattern?: Strategy is a behavioral design pattern that lets you define a family of algorithms, put each of them into a separate class, and make their objects interchangeable. The Strategy pattern (aka the policy pattern) attempts to solve the issue where you need to provide multiple solutions for the same problem so that oneContinue reading “Strategy Design Pattern (Apex Design Patterns)”

Singleton Design Pattern (Apex Design Patterns)

What is singleton?: Its a design pattern which restricts the instantiation of a class to one “single” instance only within a single transaction context. Why Singleton?: minimizing object instantiation for improved performance and to mitigate impact of governor limits Let’s discuss problem first then solution using singleton pattern- Problem: So in above example, if the record areContinue reading “Singleton Design Pattern (Apex Design Patterns)”

Apex Design Patterns

Developers around the world over the period of time invented some patterns (repeatable solutions) to solve some common occurring problems, we call it design patterns. We are working on multi tenant architecture in salesforce, all design patterns don’t work here. We have some tricky patterns here in Apex because of this architecture, we call itContinue reading “Apex Design Patterns”

Enforce Security With the stripInaccessible Method

Use the stripInaccessible method to enforce field- and object-level data protection. This method can be used to strip the fields and relationship fields from query and subquery results that the user can’t access. The method can also be used to remove inaccessible sObject fields before DML operations to avoid exceptions and to sanitize sObjects that have beenContinue reading “Enforce Security With the stripInaccessible Method”

Use the Safe Navigation Operator to Avoid Null Pointer Exceptions

Use the safe navigation operator (?.) to replace explicit, sequential checks for null references. This operator short-circuits expressions that attempt to operate on a null value and returns null instead of throwing a NullPointerException. If the left-hand-side of the chain expression evaluates to null, the right-hand-side is not evaluated. Use the safe navigation operator (?.) in method, variable, andContinue reading “Use the Safe Navigation Operator to Avoid Null Pointer Exceptions”

How to use Apex Replay Debugger

Step 1. Use the Debug: Toggle Breakpoint and SFDX: Toggle Checkpoint commands to toggle on and off breakpoints and checkpoints, respectively Step 2.  Use SFDX: Update Checkpoints in Org command to update checkpoint in the org. You must tell Salesforce about your checkpoints so that heap dumps are collected as your Apex code executes Notes:Continue reading “How to use Apex Replay Debugger”