Play Games

Search This Blog

Friday, December 13, 2024

Wednesday, December 4, 2024

How to get Salesforce Org limits in Apex


Solution:
Use the below code

List<System.OrgLimit> lstOrgLimits = OrgLimits.getAll();

for (System.OrgLimit objLimit : lstOrgLimits) {

    System.debug('Limit        : ' + objLimit.getName());

    System.debug('Current Limit: ' + objLimit.getValue());

    System.debug('Max Limit    : ' + objLimit.getLimit());

}

Output:

To get specific limit, for example file storage limit use the below code

System.OrgLimit objLimit = OrgLimits.getMap().get('FileStorageMB');

System.debug('Limit        : ' + objLimit.getName());

System.debug('Current Limit: ' + objLimit.getValue());

System.debug('Max Limit    : ' + objLimit.getLimit());

Output:



Top 10 Salesforce Youtube Channels that I follow


Below are the salesforce YouTube channels that I follow . Hope you do follow them and gain some knowledge.

1) Salesforce Developers https://www.youtube.com/@SalesforceDevs/videos

2) Salesforce Architects https://www.youtube.com/@SalesforceArchitects/videos

3) Apex Hours https://www.youtube.com/@apexhours

4) Samarth Ahuja Tech Videos https://www.youtube.com/@samCoder

5) Salesforce Techbook https://www.youtube.com/@salesforcetechbook

6) Salesforce https://www.youtube.com/@salesforce

7) Path to code https://www.youtube.com/@PathtoCode

8) Salesforce Hulk https://www.youtube.com/@SalesforceHulk

9) Salesforce Codex https://www.youtube.com/@SalesforceCodex

10) Salesforce Ben https://www.youtube.com/@OfficialSFBen