This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"author":"Rahul Malhotra","apps":[{"id":"1","title":"HTTPCalloutFramework","url":"https://github.com/rahulmalhotra/HTTPCalloutFramework"},{"id":"2","title":"SFDX Deploy Tool","url":"https://github.com/rahulmalhotra/SFDX-Deploy-Tool"},{"id":"3","title":"Platform Event Toast - LWC","url":"https://github.com/rahulmalhotra/Platform-Event-Toast-LWC"}]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"author":"Rahul Malhotra","sessions":[{"id":"1","title":"Develop Lightning Components faster using Lightning Data Service","url":"https://www.sfdcstop.com/2017/12/develop-lightning-components-faster.html"},{"id":"2","title":"Agentforce for Developers","url":"https://trailblazercommunitygroups.com/events/details/salesforce-salesforce-developer-group-new-delhi-india-presents-delhincrohana-deep-dive-into-einstein-for-developers-amp-einstein-copilot/"}]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"author":"Rahul Malhotra","blogs":[{"id":"1","title":"Building Blocks of Apex: Variables & Data Types Explained Simply - Salesforce Apex Tutorial Part 2 to 7 | Code Snippet","url":"https://www.sfdcstop.com/2024/04/variables-and-data-types-salesforce.html"},{"id":"2","title":"Collections in Apex - Salesforce Apex Tutorial Part 8 to 13 | Code Snippet","url":"https://www.sfdcstop.com/2024/08/collections-in-apex-salesforce-apex.html"},{"id":"3","title":"Apex Constants and Enums - Salesforce Apex Tutorial Part 14 to 16 | Code Snippet","url":"https://www.sfdcstop.com/2024/09/apex-constants-and-enums-salesforce.html"},{"id":"4","title":"Expressions and Operators in Apex - Salesforce Apex Tutorial Part 17 to Part 24","url":"https://www.sfdcstop.com/2024/10/expressions-and-operators-in-apex.html"},{"id":"5","title":"Control Flow Statements in Apex | if else | switch case | loops - Salesforce Apex Tutorial Part 25 and Above","url":"https://www.sfdcstop.com/2024/12/control-flow-statements-in-apex-if-else.html"}]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-> 'Create a Batch Class to opt out contact records from email, call and fax whose Unsubscribe Date has passed' | |
20,000 records -> total | |
200 records | |
How many batches? | |
-> 20,000 / 200 -> 100 batches in total |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Author:- Rahul Malhotra | |
* Description:- This batch class is used to update all contacts who have opted out of email, call and fax | |
* Created:- 18-12-2021 | |
* Last Updated:- 18-12-2021 | |
*/ | |
public class UpdateContactsBatch implements Database.Batchable<sObject> { | |
// * Return a maximum of 50 million records | |
public Database.QueryLocator start(Database.BatchableContext batchableContext) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let inputs = document.getElementsByTagName('input'); | |
for(let input of inputs) { | |
if(input.type === 'checkbox' && input.name === 'enable') { | |
input.disabled = false; | |
break; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
----------------------------------------------------------------------------------------- | |
-> Sort a list of sObject records based on field value | |
----------------------------------------------------------------------------------------- | |
List<Account> accounts = new List<Account>(); | |
accounts.add(new Account( | |
Name = 'Hooli', | |
NumberOfEmployees = 50, | |
AnnualRevenue = 10000 | |
)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
------------- | |
Enums in Apex | |
-------------- | |
An enum is an abstract data type whose values consist of a finite set of identifiers. | |
Enums are typically used to define a set of possible values that don’t otherwise have a numerical order. | |
public enum Color { RED, BLUE, GREEN, ORANGE, PURPLE } | |
values() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--------------------------------------------------------------------------------------------------------------------------- | |
Custom Comparator | |
--------------------------------------------------------------------------------------------------------------------------- | |
List<Integer> numbers = new List<Integer>{ 5, 3, 2, 1, 4 }; | |
System.debug('Initial list of Integers => ' + numbers); | |
System.debug('Sorting Integers....'); | |
numbers.sort(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// * Link accounts with parent accounts | |
Update 10,000 accounts | |
----------------------- | |
// * Brute Force Approach - Very time consuming | |
List<Account> accounts = [SELECT Reference_ID__c, Parent_Reference_ID__c FROM Account]; | |
List<Account> accountsToUpdate = new List<Account>(); |
NewerOlder