Why Are Session IDs Different Across Contexts in Salesforce?
Question: I’m implementing an OAuth flow between two Salesforce instances. A challenge I’m facing is maintaining sessions when the target instance has the same instance URL as the origin instance, causing users to be logged out of the original instance upon login to the other. To address this, I’m using…
Dynamic REST API JSON Body Using Field Sets in Apex
Question: I need to construct the request body for a REST POST call in which the key (Field API Name) and its corresponding value are dynamically included in JSON format. The field API names are retrieved from a field set, and the values come from a database query. For example,…
Publishing Platform Event with JSON in a Text Field?
Question When attempting to publish a Platform Event with a valid JSON object inside a custom text field (Message__c), the serialized JSON string appears with backslashes before special characters such as double quotes (“). For example, when assigning the following JSON to Message__c: The resulting event payload contains an escaped…
CheckMarx FLS Violations for Dynamic SObjects in Apex?
Question: In Salesforce Apex, handling objects dynamically using the generic SObject type allows for flexible and reusable code that can work across different Salesforce objects. However, this dynamic approach creates challenges for static code analysis tools like CheckMarx and PMD. For example, consider the following code snippet where QuoteLineItem records…
How to Delete Triggers or Classes from Production in Salesforce?
Question I’m encountering some confusion with deleting components in production. I understand that you can’t delete a class directly in production—you must remove it in your sandbox and then deploy the deletion using a package. However, when I delete a trigger in my sandbox, it doesn’t show up as a…
Getting Started with Writing Code in Salesforce Developer Console
Salesforce provides a powerful cloud-based platform for developing applications, and the Salesforce Developer Console is a built-in tool that allows developers to write, test, and debug Apex code efficiently. For those getting started with writing code in Salesforce Developer Console, this guide will provide a solid foundation. Enhance your expertise…
How to Deploy Apex Classes That Are Scheduled?
Question How can we manage scheduled jobs in Salesforce to allow updates to the classes they reference? Specifically, is there a way to use Type.forName or other techniques to decouple classes from scheduled jobs and enable seamless deployments of Apex classes? How do we deploy Apex classes that are scheduled?…
10 Practice Problems for APEX Triggers: A Beginner’s Guide
Apex triggers are essential tools in Salesforce development, allowing you to automate processes and create custom behaviors. Whether you’re a fresher or an experienced developer, practicing Apex trigger problems can significantly boost your understanding. In this post, I’ll walk you through 7 practice problems for Apex triggers that can help…
What is Multi-Factor Authentication (MFA) in Salesforce?
Multi-Factor Authentication (MFA) is a critical security feature in Salesforce that adds an extra layer of protection beyond just a username and password. It helps prevent unauthorized access, reduces security risks, and ensures compliance with industry regulations. In this guide, we’ll explore how MFA works in Salesforce, why it’s important,…
How to Handle Guest User CRUD/FLS in Security Review?
Question We are developing an app for the Salesforce AppExchange that integrates with external systems. During the Salesforce Security Review, we encountered an issue related to CRUD (Create, Read, Update, Delete) and Field-Level Security (FLS) checks in Apex code. Salesforce’s security guidelines require that all Apex code performing DML operations…

