JWT vs JWT Token Exchange in Salesforce
Question When configuring Named Credentials in Salesforce with the Identity Type set as “Named Principal,” two options for Authentication Protocol are presented: JWT and JWT Token Exchange. Many users wonder what distinguishes these two options, especially when additional attributes, such as Scope and Token Endpoint URL, appear in the JWT…
Why Can’t We Upcast Sets in Salesforce?
Question When working with Apex collections, such as Sets, a common assumption is that we can upcast a Set<Account> to a Set<sObject> since Account inherits from sObject. However, attempting to do so results in errors during compilation or runtime. Here’s an example: This code produces the error: The behavior might…
How to Call Future Method from Batch Apex?
When working with Salesforce Batch Apex, it’s important to understand the limitations around calling asynchronous methods like future methods. While it is not directly possible to invoke a future method from a batch, there are several alternatives to work around this limitation. Here’s a deeper dive into these alternatives and…
Submit recordEditForm from another’s success?
Question: I have two <lightning:recordForm> components in my Aura component. When the first form submits and succeeds, I want to automatically submit the second form to make it appear as a single transaction to the user. I am using the onsuccess handler of the first form to call: However, the…
Standard Contact Phone Field Not Visible in Flow?
Question: I am trying to create a Contact record using a record-triggered flow in Salesforce, but I am unable to find the standard ‘Phone’ field among the available fields to populate. I have already checked the field-level security (FLS), and it is set to visible for all profiles. Why is…
SOQL LAST_N_DAYS:30 vs. Reports: Why Different Results?
Question I noticed a discrepancy between SOQL queries and Salesforce reports when filtering for the last 30 days. In a Salesforce report, selecting “Last 30 Days” includes records from 2024-11-14 to 2024-12-13, exactly 30 days (including today). However, when I run the following SOQL query: it includes records from 2024-11-13…
Salesforce Org Authorization Fails in VS Code?
Question: I can create a Salesforce project in VS Code, but when I try to authenticate an org, it opens a browser where I enter my credentials. The browser confirms “Authentication successful,” but in VS Code, the process remains stuck at “in progress.” If I cancel it, I get the…
Sending Form-Data in Apex Callout to Auth0?
Question: I need to send a multipart/form-data request from Salesforce Apex to Auth0’s /api/v2/jobs/users-imports endpoint. I have limited experience working with form-data requests. I structured the request body as follows: My Apex code: However, I keep getting this error response: What is wrong with my request, and how can I…
Send Survey to Case SuppliedEmail When Case is Closed?
Question I have created a survey to collect customer feedback and want to send it to the SuppliedEmail field on the Case object when the case is closed. I checked the Case Auto-Response Rules and the Support Settings > Customer Feedback Survey, but I couldn’t find an option to send…
How to Block Recursion in a Generic Trigger Handler?
Question When implementing a generic trigger handler that processes all TriggerOperation types and supports arbitrary SObjectType, recursion can become a major issue. Recursion occurs when a trigger causes an update that invokes the same trigger again, leading to infinite loops or redundant processing. Consider the following example trigger: With the…

