Category Archives : Apex

Can we use the event’s “path” attribute in Lightning Components?

On October 22, 2025, Posted by , In Admin Tutorial,Apex, By ,, , With Comments Off on Can we use the event’s “path” attribute in Lightning Components?

When developing Aura or Lightning components in Salesforce, we often deal with events such as onfocus, onclick, or onchange. These events help us detect user actions and update component data accordingly. One common situation occurs when you have a repeating list of elements — for example, a list of input…

How to Implementing Dependent Picklists in Lightning Components?

On October 20, 2025, Posted by , In Admin Tutorial,Apex, With Comments Off on How to Implementing Dependent Picklists in Lightning Components?

Question: In Salesforce, dependent picklists can be configured in Setup and are fully supported in Visualforce, where the dependent picklist automatically updates based on the controlling picklist’s value. Are dependent picklists natively supported in Lightning Components as well? If not, what is the recommended approach to implement them in Lightning,…

Rendering force:Field Inside Custom Markup?

On October 18, 2025, Posted by , In Admin Tutorial,Apex, With Comments Off on Rendering force:Field Inside Custom Markup?

Question: I am trying to use <force:inputField> and <force:outputField> in my Lightning Component and want to wrap them in custom markup like <div> or <article> for styling as cards. However, when I place these components inside any markup, they do not render in Lightning Experience. They work fine when used…

What is the best way to get the Record Type ID in Apex?

On October 14, 2025, Posted by , In Admin Tutorial,Apex, By , , With Comments Off on What is the best way to get the Record Type ID in Apex?

When developing in Salesforce, especially for managed packages or production-grade Force.com applications, one common question arises: What is the best approach to retrieve a Record Type ID in Apex? There are a few ways to get the Record Type ID of a specific record type, but choosing the right one…

Uncommitted Work Pending in Test with System.runAs?

On September 21, 2025, Posted by , In Apex,Salesforce Training, With Comments Off on Uncommitted Work Pending in Test with System.runAs?

Question: I am writing a test class where I need to run the test as two different users, because the approveForm method contains a validation that prevents the creator of the form from approving it. In my test for approval, I am consistently running into the “Uncommitted work pending” issue,…

Sending Form-Data in Apex Callout to Auth0?

On September 4, 2025, Posted by , In Apex,Salesforce Technical Questions, With Comments Off on 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…

How to Block Recursion in a Generic Trigger Handler?

On September 1, 2025, Posted by , In Apex,Salesforce Technical Questions, With Comments Off on 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…

Combobox Performance Issue in LWC?

On August 27, 2025, Posted by , In Apex,Salesforce Technical Questions, With Comments Off on Combobox Performance Issue in LWC?

Question: I am facing a performance issue with a combobox in LWC. I found similar questions suggesting that using the spread operator on the data should work, but it still takes a lot of time to load. However, when I pass the data as a JSON string and parse it,…

Contact Mass Update – Apex CPU Time Limit Exceeded?

On August 21, 2025, Posted by , In Apex,Salesforce Technical Questions, With Comments Off on Contact Mass Update – Apex CPU Time Limit Exceeded?

Question I am trying to perform a mass update on Contact records using Execute Anonymous, but I keep getting the following error: System.LimitException: Apex CPU Time Limit Exceeded Here is the code I am using: What is causing this error, and how can I optimize my approach to avoid hitting…

Updating PermissionSetTabSetting Without Metadata API?

On August 14, 2025, Posted by , In Apex,Salesforce Technical Questions, With Comments Off on Updating PermissionSetTabSetting Without Metadata API?

Question: I need to update the visibility settings for tabs within a Permission Set in Apex. I successfully retrieved PermissionSetTabSetting records but encountered an issue when trying to upsert changes in a loop. Here’s my approach: However, I keep getting this error:System.DmlException: Upsert failed. First exception on row X; first…