How should you manage the API version of Apex classes in Salesforce?
What is the best practice for managing the API version of Apex classes in Salesforce? When you have older Apex code written 12–18 months ago with API versions between 27.0 and 29.0, should you leave these versions as they are, or should you regularly update them to newer API versions?…
How do I write a proper unit-test for an Apex Trigger?
Writing test classes for Apex triggers is one of the most commonly asked Salesforce questions. Developers often wonder whether the test logic should live “inside” a trigger, in a separate class, or somewhere else. The short answer is that Salesforce requires you to write at least one test method that…
How to Fix ContentDocumentLink Duplicate Errors?
When uploading files using <lightning-file-upload> in an LWC, Salesforce automatically creates a ContentDocumentLink between the uploaded file and the record-id provided. In your case, you are also creating another ContentDocumentLink in Apex to the same contact. This creates a conflict and causes the error: So the main issue is that…
How Do I Bulkify Queries for Related Records in Apex?
How can I properly bulkify my Apex code when I need to query records that are directly or indirectly related to a collection of input records, such as Trigger.new or a list of SObjects? When I place queries inside loops, Salesforce throws SOQL limit errors. What are the best patterns…
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…
How to get URL Parameters in Aura Component?
When working with Salesforce Communities or Lightning components, a common requirement is to read query string parameters from the URL and display them directly in the component. Initially, many developers use JavaScript to parse URL parameters and pass them into component attributes, but Salesforce introduced a more declarative way from…
Create Custom Objects, Apps & Fields in Salesforce
Salesforce is not just a CRM, it is a powerful platform that allows businesses to customize their environment according to their processes. Learning to create custom objects, apps, and fields empowers Salesforce Admins to tailor Salesforce to business needs without code, aligning seamlessly with automation and reporting. This step-by-step guide will help you understand visually and practically how…
Text Types – Custom Fields in Salesforce
Are you learning Salesforce Admin and wondering how to work with custom fields and text types? In this tutorial, we will learn step-by-step how to create custom fields of Text, Text Area, and Rich Text Area in Salesforce Lightning with practical screenshots for your clear understanding. Whether you are preparing…



