Coming Soon to Boostr: Viewing Other Org Limits

Have you ever wondered what your daily email limit is and how many emails can still be sent? Ever wanted it to show on the System Overview page in setup? Yea me too… so … I added another enhancement to Boostr for Salesforce that shows that and all the other Org limits on the system overview page that are returned via the Limits REST API.  This is coming in the next Boostr release… Stay tuned.

Technical Bits

High-Level Algorithm

  1. When on the system overview page, grab the current user’s session id from their Salesforce cookie. This is needed because the Salesforce APIs only allow an authorized user to make API calls.
  2. Using the session id, make a callout to the Limits REST API at /services/data/v40.0/limits/
  3. If successful and the limits are returned, show the limits on the system overview in a new “Other Org Limits” section that looks and feels like the other limit sections.

Full Code

Wanna see the full code? View the Pull Request.

Inspiration

Not so long ago, Matt Addy asked how to find out what the Saleforce daily email limit is on Slackforce. We basically said that has always been a tricky question to answer because the formula Salesforce uses is complicated and there’s neither an easy way to find out using the Apex Limits object nor through the Salesforce setup area either.

The Limits object has a getEmailInvocations method and a getLimitsEmailInvocations method but those tell the currently executing code how many emails have been sent in this context and how many are still allowed. At the time of this writing, 10 emails can be sent programmatically per execution context.

After some more digging, it turns out that the Limits REST API returns the number of daily emails limit and how many are remaining along with many other limits.

Have a feature you’d like to have in Boostr? Submit a feature request issue in GitHub and a contributor may implement it. Or you can implement it yourself by following the Contribution instructions.

Related Posts

Boostr Posts

Coming Soon to Boostr: Classic Listview Row (De)Selecting

Nick Snyder recently added changeset row clicking (de)selecting support to Boostr which is very nice. It helped me immediately after release and saved a bunch of time.

He inspired me to add that capability to object listviews and setup listviews in Salesforce Classic. I implemented this via this pull request and it’ll be added to Boostr soon.

Object Listview Row (De)Selecting

When one opens an Object Listview that has the row checkbox, as seen below, clicking the row will either check or uncheck the checkbox.

Setup Listview Row (De)Selecting

Support has also been added to setup listviews such as the Users area. When the row is clicked, the checkbox is either checked or unchecked.

Technical Details

High-Level Algorithm

  1. If in Salesforce Classic, attach row click event handler to setup listviews. Also, attach a MutationObserver looking for object listview creation.
  2. If an object listview is dynamically added to the page, attach row click event handler.
  3. If an object or setup listview row is clicked, invoke the row’s checkbox’s click event to either check or uncheck it.

Why No Lightning Support?

I’m actually working on this as we speak. To see the progress made so far, see the lightning-listview-row-clicking Boostr branch. However, I’ve run into a roadblock where clicking the row selects or unselects the checkbox but then some other piece of code clicks it again making it appear as though it wasn’t clicked.

My preference is to release something that helps rather than release nothing that doesn’t help so that’s why Classic support is out first. (Hopefully, I can figure out the lightning fix and get it out in the same release).

Have a feature you’d like to have in Boostr? Submit a feature request issue in GitHub and a contributor may implement it. Or you can implement it yourself by following the Contribution instructions.

Related Posts

Boostr Posts