-

Learning Apex Triggers (Part 1) – Understanding Trigger Basics
Introduction: Welcome to our first blog post, in “Learning Apex Triggers” series. In this blog post, we will be learning about basics of apex triggers, their events and features. An Apex Trigger is custom Salesforce code. It runs before or after database operations (like insert, update, delete) on a record. Apex triggers are a powerful…
-
Learning Batch Class in Apex (Salesforce)
A batch class in Salesforce is a class that is used to process large amounts of data in smaller, manageable chunks, also known as batches. This allows for efficient processing of large data sets without exceeding platform limits. They can be used for operations such as data migration, validation, and mass updates. Batch class implement…
-

Roll Up Summary Trigger To Update Total Contact On Account In Salesforce
Introduction: In this blog post, we will see an example on how to roll up child values on a parent record. This applies to both master-detail and lookup relationships. In this example. we will demonstrate updating total contacts count on Account. This will be done using roll up summary apex trigger and aggregate query. The…
-
Use of Maps Data Collection in Apex (Part -2)
3. If map of <Id/String.etc,Decimal> is required and you need to sum/count all the child records – Below is an example in Apex. It can be used to create a map to track the total opportunity amounts for each account. The key is the Opportunity Account Id’s. The value is the sum of all opportunities…
-
Use of Maps Data Collection in Apex (Part -1)
Map data collection in Apex Salesforce is used to store key-value pairs The key and value can be of data type—primitive types, collections, sObjects, user-defined types, and built-in Apex types. Maps are useful for working with large data sets, storing multiple values for a single key, and performing operations on groups of similar data Can…
-

Roll up summary trigger To Update Child Records Count and total Sum of values of child records on Parent Record using aggregate query
Introduction: In this blog post, we will explore an example that shows how to roll up child counts using aggregate query. It will also demonstrate how to sum values on a parent record. This example applies to lookup relationships but you can use the same with master-detail also. Example Scenario: Imagine a business that manages…
-

Roll up summary trigger To Update Child Records Count and total Sum of values of child records on Parent Record using Maps
Roll Up Summary Trigger example, if parent is having a look up relationship with child
-
Passing more than one parameter in a apex method as a single parameter from lightning component or refactoring the apex method.
In this post, we will see how to resolve the “CognitiveComplexity” Apex PMD error. Your apex method might be having more than one parameter. We will explore how you can make your apex method generic to get n numbers of parameters. When working with Salesforce Apex and JavaScript, you might need to pass multiple parameters…
-
How to create a Map of AccountId and List of Contacts – Map<Id,List()
To create a Map of AccountId and List of Contacts in Apex, you can use the following code: This code creates an empty map called accountContactsMap and then queries the Contact object to get a list of all Contact records. It then iterates through the list of Contacts and adds each Contact to the map,…
-
Creating Picklist from Sobject Field values in Lightning
apex class [ fetchPicklistOptsController.apxc ] Component [sample.cmp] Controller [ sampleController.js] Helper [sampleHelper.js] TestApp.app
