Skip to content

Check whether the high-priority Case backlog is within capacity

Setup reference: Query Check configuration

Create a Query Check that counts visible, open, high-priority Cases related to an Account. The example passes when the count is three or fewer; replace three with your approved limit.

Cases are related records and the result is an aggregate count, so Verify with a query handles the requirement without Apex. The card provides situational guidance without blocking Case saves.

  • Confirm High is the stored Case Priority value in your org.
  • Replace three with a capacity limit approved by the service team.
  • Confirm intended users can read Case Account, Is Closed, and Priority.
  • Save new configuration inactive and validate it before activation.

Use Account Related Record Review, or create an Account Check Set that runs on click, shows Found/Expected on demand, and remains inactive until validation succeeds.

Open Setup → Custom Metadata Types → Record Health Check → Manage Records, select New, and enter:

Salesforce fieldValue
LabelHigh-Priority Case Limit
Record Health Check NameHigh_Priority_Case_Limit
Check SetAccount Related Record Review
Check TitleHigh-priority Case backlog is within capacity
Evaluation TypeVerify with a query
Source QuerySELECT COUNT() FROM Case WHERE AccountId = {!record.Id} AND IsClosed = false AND Priority = 'High'
Source Query FieldLeave blank for COUNT()
How To Read Query ResultsOne row or aggregate
Comparison OperatorLess than or equal
Expected Value Comes FromFixed value
Expected Value (Fixed)3; replace with the approved limit
Max Query Rows200
Failure SeverityWarning
Message When Failed{!record.Name fallback="This Account"} has more open high-priority Cases than the normal review capacity.
Message When Unable To EvaluateUnable to count high-priority Cases. Confirm access to the queried fields.
Fix MessageReview ownership and response plans, then follow the capacity-escalation process.
Action LabelReview cases
Action URL/lightning/r/Account/{!record.Id}/related/Cases/view
Evaluation Order140
ActiveUnchecked until validation succeeds

Bare COUNT() returns zero instead of no rows, so zero matching Cases passes rather than skips.

  1. Confirm the Priority value and approved limit.
  2. Run the configuration-validation Flow.
  3. Correct every error, then activate the Check and Check Set.
  4. Test from the Account page with Record Health Check Card User.
Visible open high-priority CasesExpected result
0Pass; Found is 0 and Expected is 3
3Pass
4Warning
4, with one Case hidden from the userPass for that user because the visible count is 3

If automation consumes results, enable Publish User Result Event only after the receiving Flow, Apex trigger, or integration is tested. Events publish for an explicit Run or Rerun, not an automatic page-load evaluation. See lifecycle events.

The card reads the visible query result and compares it with the configured expected value.

Result detailMeaning
PASSThe query result satisfies the configured comparison.
FAILThe query result does not satisfy the comparison, and the card shows the configured guidance.
SKIPPEDThe Check does not apply or a configured prerequisite did not pass.
FoundThe normalized row, list, or aggregate value returned by the query.
ExpectedThe configured fixed value or evaluated expected formula.
What you seeCheck this first
Count is lower than expectedConfirm Case sharing and the exact Priority and Is Closed filters
Three Cases failConfirm Less than or equal, not Less than
Source Query Field validation failsLeave it blank for bare COUNT()
Unable to CheckConfirm Case object and queried-field access