Skip to content
Suggest a correction

Check that an Account has a significant open Opportunity

Example5 min read

Create a Record Health Check that passes when at least one open Opportunity on an Account has an Amount greater than 10% of the Account’s Annual Revenue. Accounts without a positive Annual Revenue show Skipped. The example uses the Verify with a query Evaluation Type, comparing each Opportunity with a value calculated from the Account.

The Amounts are on related Opportunities, and the threshold comes from the Account itself. A query Check can return the Opportunity Amounts, calculate the threshold with a formula on the Account, and pass when any one Opportunity exceeds it.

  • Install Record Health Check, and assign yourself Record Health Check Admin and the Salesforce Customize Application permission.
  • Confirm that Annual Revenue is maintained and that 10% is the approved threshold.
  • Confirm that the people who will use the card can read Annual Revenue on Accounts and Amount on Opportunities.
  • This example is for an org with a single currency. Record Health Check never converts currencies, and in an org with multiple currencies it requires each queried currency value to identify its currency. Read the Query reference before adapting it.

You can add the Check to an Account Check Set you already have. To create one, open Setup → Custom Metadata Types, select Manage Records next to Record Health Check Set, select New, enter these values, and save. Leave other fields at their defaults.

FieldValue
LabelAccount Related Record Review
ObjectAccount
Record Health Check Set NameAccount_Related_Record_Review
ActiveCleared until validation succeeds
Card TitleAccount Related Record Review
Card SubtitleConfirm related records are ready for handoff.
When Checks RunWhen the user clicks Run
Found/Expected DisplayShow on demand

Open Setup → Custom Metadata Types, select Manage Records next to Record Health Check, select New, enter these values, and save.

FieldValue
LabelHas Significant Open Opportunity
Check SetAccount Related Record Review
Evaluation TypeVerify with a query
Record Health Check NameHas_Significant_Open_Opportunity
Evaluation Order30
ActiveCleared until validation succeeds
Source QuerySELECT Amount FROM Opportunity WHERE AccountId = {!record.Id} AND IsClosed = false AND Amount != null
Source Query FieldAmount
How To Read Query ResultsAny record passes
Comparison OperatorGreater than
Expected Value Comes FromRecord formula
Expected Value (Formula)AnnualRevenue * 0.1
If Query Finds No RecordsFail
If Field Value Is EmptyTreat as not matching
Check TitleAccount has a significant open Opportunity
Check DescriptionPasses when an open Opportunity’s Amount is more than 10% of the Account’s Annual Revenue.
Message When Failed{!record.Name fallback="This Account"} has no open Opportunity worth more than 10% of its Annual Revenue.
Fix MessageReview Annual Revenue and the open Opportunity Amounts. Correct a value only if it is wrong.
Message When Unable To EvaluateUnable to compare Opportunity Amounts with Annual Revenue. Confirm that you can read both fields.
Failure SeverityInfo
Applies ToWhen a formula is true
Applies When (Formula)BLANKVALUE(AnnualRevenue, 0) > 0
Message When Not Applicable{!record.Name fallback="This Account"} has no Annual Revenue, so there is no threshold to compare.
Formula Result TypeNumber

How the values work:

  • Any record passes passes when at least one returned Amount is Greater than the expected value.
  • Expected Value (Formula) calculates the threshold on the open Account. For Annual Revenue of 1,000,000, the threshold is 100,000.
  • Formula Result Type set to Number tells Record Health Check that the expected-value formula returns a number. Automatic also works, but it uses more of the formula budget per record.
  • If Query Finds No Records set to Fail treats an Account with no open Opportunities as needing attention.
  • Applies When (Formula) skips Accounts whose Annual Revenue is blank or 0, because 10% of nothing is not a useful threshold.

This Check has no Action URL, because the fix can be on the Account or on an Opportunity.

  1. Run the Validate Record Health Check Configuration Flow action, as described in Validate configuration before activation, and correct every error.
  2. Activate the Check, then the Check Set.
  3. Add the Record Health Check component to the Account record page, select Account Related Record Review (Account_Related_Record_Review), and activate the page.
  4. Assign Record Health Check Card User to the users who test the card.

Select Run on the card for each case.

Annual RevenueOpen Opportunity AmountsResult on the cardWhy
Blank or 0AnySkippedThe Check does not apply.
1,000,000NoneInfoNo records, and If Query Finds No Records is Fail.
1,000,00075,000 and 100,000Info100,000 is not greater than 100,000.
1,000,00075,000 and 125,000Pass125,000 is greater than 100,000.

A failed row shows Info, because Failure Severity is Info, with the message and fix message. Found lists the open Opportunity Amounts, and Expected reads “more than” followed by the threshold. The Check reviews only Opportunities the running user can see; a hidden qualifying Opportunity cannot make it pass.

What you seeWhat to check
An Amount equal to the threshold failsExpected with Greater than. Choose At least if an equal Amount should pass.
Every Account shows SkippedThe Account’s Annual Revenue is populated and greater than 0.
A qualifying Opportunity is not foundThe Opportunity is open, has an Amount, and is visible to the user.
Unable to CheckThe user can read Annual Revenue and Opportunity Amount.