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
clear(): | |
---------- | |
Set<Integer> numbers = new Set<Integer>{30,30,30,20,20,10,40,40}; | |
System.debug(numbers); | |
numbers.clear(); | |
System.debug(numbers); | |
isEmpty(): | |
----------- |
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
Set Data Structure in Apex | |
------------------------------- | |
Def: A set is an unordered collection of elements that do not contain any duplicates. | |
1. Creating a set of Integers | |
Set<Integer> numbers = new Set<Integer>(); | |
System.debug(numbers); |
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
List<SObject> records = new List<SObject>(); | |
records.add(new Account(Name='Test Account', Reference_ID__c = 234)); | |
records.add(new Contact(LastName='Test Contact', AccountId = null, Account = new Account(Reference_ID__c = 234))); | |
Database.upsert(records); |
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
List<SObject> records = new List<SObject>(); | |
records.add(new Account(Name='Test Account', Reference_ID__c = 123)); | |
records.add(new Contact(LastName='Test Contact', Account = new Account(Reference_ID__c = 123))); | |
Database.upsert(records); |
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
List<Account> accounts = new List<Account>(); | |
for(Integer i=1; i<=10000; i++) { | |
accounts.add(new Account(Name = 'Account ' + i)); | |
} | |
insert accounts; | |
List<Account> accounts = [SELECT Id FROM Account]; | |
System.debug('Heap size when queried list of accounts = ' + Limits.getHeapSize()); |
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
List Data Structure in Apex | |
------------------------------- | |
1. Creating a list of Integers | |
List<Integer> numbers = new List<Integer>(); | |
System.debug(numbers); | |
List<Integer> numbers = new List<Integer>{10,20,30,40,50,60,70}; |
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:- Utility class consisting of some common methods | |
* Created Date:- 08-08-2021 | |
* Last Modified:- 08-08-2021 | |
* Code Origin:- SFDC Stop (https://www.sfdcstop.com) | |
*/ | |
public with sharing class ApexUtil { | |
/* |
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
SELECT | |
ApexClassId, | |
ApexClass.name, | |
Id, | |
JobItemsProcessed, | |
JobType, | |
Status, | |
NumberOfErrors, | |
MethodName | |
FROM AsyncApexJob |
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
SELECT | |
ID, | |
CronExpression, | |
CronJobDetail.Name, | |
CronJobDetailId, | |
EndTime, | |
NextFireTime, | |
PreviousFireTime, | |
StartTime, | |
State, |
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
npm install -g node-gyp |