This repository contains all the code you need to set up a Visualforce page in your Salesforce Org that can be used to display the current limit usage for your org. The page gathers the information from the Salesforce REST API resource `/services/data/v37.0/limits' which is fully documented in the REST API Documentation.
The Visualforce page uses an open source JavaScript library called JustGage to simply display the results in a series of gauges on the Visualforce page. The JSON response coming to the Visualforce page can also be used to generate the information in any format you choose.
- Download this repo as zip file
- Deploy the code to your Salesforce org using the MdAPI through Workbench, Force.com IDE, or Ant Migration Tool
- Assign the included OrgLimits permission set to your user
- Create a Remote Site Setting to allow the Apex Class to call the Salesforce REST API
- Navigate to Setup > Security Controls > Remote Site Settings
- Find the Remote Site Setting names "OrgLimits" and click Edit
- Change the Remote Site URL field from
https://c.instance.visual.force.com
to your Visualforce instance- You can find this in the browser address bar when you are Displayiong a Visualforce Page.
- Alternatively, if you proceed to Step 5 you will see an error with the appropriate instance if you have not completed this step. Simply copy the domain from the error and add that to the Remote Site Setting. The error will say something like:
Unauthorized endpoint, please check Setup->Security->Remote site settings. endpoint = https://c.na3.visual.force.com/services/data/v35.0/limits
- Add the Custom Tab "OrgLimits" to your Tab Layout, or go to
/apex/OrgLimits
to view your daily limits
- If there is an error from the API call, the Visualforce Page will not have any data in the gauges
- The running user must have access to the Salesforce API by enabling in remote site settings
##To install as unmanaged package click here
- There are provided tests in the package, but you may want to beef up the tests for your environment
- If there is an error form the API call, the Visualforce Page will not have any data in the gauges
- The running user must have access to the Salesforce API