Giter Club home page Giter Club logo

salesforce-limit-monitor's Introduction

salesforce-limit-monitor

App for monitoring Salesforce org limits. This app will send push notifications when you are at 80% (default) of a limit or if it increases 20% (default) or more from one snapshot to the next. By default, it snapshots limits once per hour. All options can be changed on a per limit basis.

You can also mute notifications for a certain time period or temporarily increase the alert threshold.

Installation steps

โš ๏ธ There is a known issue that prevents users from opening process builder from unlocked packages. Until this error is fixed, you won't be able to modify them. See https://success.salesforce.com/issues_view?id=a1p3A0000003UVoQAM

  1. Clone and deploy using sfdx or as an unlocked package (https://login.salesforce.com/packaging/installPackage.apexp?p0=04t4O000000MjS8QAK)
  2. If you want to send emails people or systems not in Salesforce. Update the email alerts with the correct email address.
  3. To get emails and push notifications, add users to the Limit Notification Queue.
  4. You may have to edit the two invocable processes once deployed because the process builder metadata contains the queue Id and it doesn't deploy correctly.
  5. Add Limits records for limits you want to monitor. Make the owner be the Limit Notification Queue to send an email to all members of the queue. To add all limits, run this in Execute Anonymous:
Id limitsQueue = [SELECT Id FROM Group WHERE DeveloperName = 'Limit_Notification_Queue'].Id;
Map<String,System.OrgLimit> limitsMap = OrgLimits.getMap();

List<Limit__c> limits = new List<Limit__c>();
for (String lim : limitsMap.keySet()) {
    limits.add(new Limit__c(
        OwnerId = limitsQueue,
    	Name = lim,
    	LimitKey__c = lim
    ));
}

insert limits;
  1. Schedule the monitoring job using Execute Anonymous. In this case, it is scheduled to run every 15 minutes:
System.schedule('Limits Monitor 1', '0 0 * * * ?', new LimitsSnapshotSchedule());
System.schedule('Limits Monitor 2', '0 15 * * * ?', new LimitsSnapshotSchedule());
System.schedule('Limits Monitor 3', '0 30 * * * ?', new LimitsSnapshotSchedule());
System.schedule('Limits Monitor 4', '0 45 * * * ?', new LimitsSnapshotSchedule());

salesforce-limit-monitor's People

Contributors

dhoechst avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.