How do I effectively test asynchronous Apex in Salesforce?
Testing asynchronous Apex in Salesforce requires a slightly different approach compared to testing synchronous code. Asynchronous Apex includes any process that runs outside the main transaction, such as @future methods, Batch Apex, Queueable Apex, and Scheduled Apex. Because these processes are executed asynchronously by the Salesforce system, there is no…
How do I call the Salesforce API from a Lightning Component?
When working with Lightning Components, you may run into scenarios where you need to make API calls to Salesforce itself, such as calling the Metadata API or querying org limits. A common issue developers face is that there is no direct way to acquire a valid API session ID from…
How to use Fieldsets with Lightning?
Fieldsets in Salesforce are powerful because they allow admins to decide which fields appear on a form without developers hardcoding them. When using Lightning Components (Aura), we can render dynamic fields based on a fieldset. The challenge is that Aura-enabled Apex methods cannot return a FieldSet directly. There are two…
How to Get Values from force:recordData on Init in an Aura Component?
When working with force:recordData in an Aura component, one of the common challenges developers face is trying to access the record values in the init handler. At first glance, it may seem logical to expect that the data is available during component initialization. However, the important point to understand is…
Editable Picklist in LWC Table?
When working with editable records in Lightning Web Components (LWC), you may run into situations where you want to display fields in a table-like structure, iterate over them using for:each, and allow users to edit certain fields. For text or number fields, the lightning-input component works fine, but for a…
How Can We Deploy Apex Classes That Are Scheduled?
Question When deploying Apex classes that are scheduled, the main challenge is that Salesforce locks scheduled Apex jobs to the specific class they reference. This can cause deployment failures if you try to update a scheduled class without first unscheduling its jobs. How can we effectively deploy updates to scheduled…
Why Can’t I Add a Property to the Apex Result Array?
Question I’m trying to add a new property called showDeleteButton to each object in the result array returned from an Apex call. However, when I include the result.forEach line, the code after it does not execute. It seems like the mutation is not working as expected, and the array remains…
Apex API 61: No More Private Method Overriding?
Question After upgrading from API version 60.0 to 61.0, I noticed an unexpected change in the behavior of inheritance for inner classes in Apex. Specifically, I observed that private methods in a superclass are no longer overridden by an inner class in the subclass when both methods have the same…
How to Automate Password Expiry Reminders?
Question I want to automate the process of sending email reminders to Customer Community users when their password is about to expire in 7 days. However, my organization uses multiple profiles for Customer Community users, and each profile has its own password expiration policy (e.g., 90-day expiration, 180-day expiration, etc.)….