Check that an Account has a significant open Opportunity
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.
Why a query fits
Section titled “Why a query fits”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.
Before you start
Section titled “Before you start”- 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.
Step 1: Create or choose the Check Set
Section titled “Step 1: Create or choose the Check Set”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.
| Field | Value |
|---|---|
| Label | Account Related Record Review |
| Object | Account |
| Record Health Check Set Name | Account_ |
| Active | Cleared until validation succeeds |
| Card Title | Account Related Record Review |
| Card Subtitle | Confirm related records are ready for handoff. |
| When Checks Run | When the user clicks Run |
| Found/Expected Display | Show on demand |
Step 2: Create the Check
Section titled “Step 2: Create the Check”Open Setup → Custom Metadata Types, select Manage Records next to Record Health Check, select New, enter these values, and save.
| Field | Value |
|---|---|
| Label | Has Significant Open Opportunity |
| Check Set | Account Related Record Review |
| Evaluation Type | Verify with a query |
| Record Health Check Name | Has_ |
| Evaluation Order | 30 |
| Active | Cleared until validation succeeds |
| Source Query | SELECT Amount FROM Opportunity WHERE AccountId = {!record. |
| Source Query Field | Amount |
| How To Read Query Results | Any record passes |
| Comparison Operator | Greater than |
| Expected Value Comes From | Record formula |
| Expected Value (Formula) | AnnualRevenue * 0. |
| If Query Finds No Records | Fail |
| If Field Value Is Empty | Treat as not matching |
| Check Title | Account has a significant open Opportunity |
| Check Description | Passes when an open Opportunity’s Amount is more than 10% of the Account’s Annual Revenue. |
| Message When Failed | {!record. |
| Fix Message | Review Annual Revenue and the open Opportunity Amounts. |
| Message When Unable To Evaluate | Unable to compare Opportunity Amounts with Annual Revenue. |
| Failure Severity | Info |
| Applies To | When a formula is true |
| Applies When (Formula) | BLANKVALUE(AnnualRevenue, 0) > 0 |
| Message When Not Applicable | {!record. |
| Formula Result Type | Number |
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.
Step 3: Validate and activate
Section titled “Step 3: Validate and activate”- Run the Validate Record Health Check Configuration Flow action, as described in Validate configuration before activation, and correct every error.
- Activate the Check, then the Check Set.
- Add the Record Health Check component to the Account record page, select Account Related Record Review (Account_Related_Record_Review), and activate the page.
- Assign Record Health Check Card User to the users who test the card.
Step 4: Test the Check
Section titled “Step 4: Test the Check”Select Run on the card for each case.
| Annual Revenue | Open Opportunity Amounts | Result on the card | Why |
|---|---|---|---|
| Blank or 0 | Any | Skipped | The Check does not apply. |
| 1,000,000 | None | Info | No records, and If Query Finds No Records is Fail. |
| 1,000,000 | 75,000 and 100,000 | Info | 100,000 is not greater than 100,000. |
| 1,000,000 | 75,000 and 125,000 | Pass | 125,000 is greater than 100,000. |
What users see
Section titled “What users see”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.
Resolve problems
Section titled “Resolve problems”| What you see | What to check |
|---|---|
| An Amount equal to the threshold fails | Expected with Greater than. Choose At least if an equal Amount should pass. |
| Every Account shows Skipped | The Account’s Annual Revenue is populated and greater than 0. |
| A qualifying Opportunity is not found | The Opportunity is open, has an Amount, and is visible to the user. |
| Unable to Check | The user can read Annual Revenue and Opportunity Amount. |