Skip to content

Check whether the Account Team covers open Opportunity owners

Create a Check that compares open Opportunity Owner IDs with Account Team Member User IDs. It passes only when every visible open Opportunity owner appears on the visible Account Team.

This requirement compares two lists on related records. Compare two queries can verify complete list coverage without custom Apex.

  • Confirm Account Teams are enabled and your process requires Opportunity owners to be explicit Account Team members.
  • Confirm intended users can read open Opportunities, their owners, and Account Team Members.
  • Decide how empty lists should behave. This example fails when either required list is empty.
  • Save new configuration inactive and validate it before activation.

Use Account Record Alignment, or create an Account Check Set that runs on click and remains inactive until validation succeeds.

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

Salesforce fieldValue
LabelAccount Team Covers Opportunity Owners
Record Health Check NameAccount_Team_Covers_Opportunity_Owners
Check SetAccount Record Alignment
Check TitleAccount Team covers Opportunity owners
Evaluation TypeCompare two queries
Source QuerySELECT OwnerId FROM Opportunity WHERE AccountId = {!record.Id} AND IsClosed = false
Source Query FieldOwnerId
Comparison QuerySELECT UserId FROM AccountTeamMember WHERE AccountId = {!record.Id}
Comparison Query FieldUserId
How To Read Query ResultsCompare as lists
Comparison OperatorLists contain all
If Query Finds No RecordsFail
Failure SeverityWarning
Message When FailedOn {!record.Name fallback="this Account"}, one or more open Opportunity owners are missing from the Account Team.
Message When Unable To EvaluateUnable to compare Opportunity owners with Account Team Members.
Fix MessageReview missing owners and update only the records required by your handoff policy.
Evaluation Order10
ActiveUnchecked until validation succeeds

The Source list contains Opportunity Owner IDs. The Comparison list contains Account Team User IDs. Lists contain all verifies that the Account Team contains every source value. Leave action fields blank unless you have tested an org-specific Account Team destination.

  1. Run the configuration-validation Flow.
  2. Confirm the list direction and empty-list policy, then correct every error.
  3. Activate the Check and Check Set only after validation succeeds.
  4. Test from the Account page with Record Health Check Card User.
Open Opportunity ownersAccount Team membersExpected result
NoneAnyWarning under this example’s empty-list policy
AAPass
A, BAWarning
A, BA, B, CPass

Repeat as a restricted user. Both lists reflect the running user’s visible records.

The card compares the two visible query results using the configured list or numeric operator.

Result detailMeaning
PASSThe source and comparison results satisfy the configured operator.
FAILThe results do not satisfy the operator, and the card shows the configured guidance.
SKIPPEDThe Check does not apply or a configured prerequisite did not pass.
FoundThe normalized result returned by the source query.
ExpectedThe normalized result returned by the comparison query.
What you seeCheck this first
The relationship passes in the wrong directionSource must be Opportunity OwnerId; Comparison must be Account Team UserId
All Accounts failConfirm Account Teams are enabled and team rows are visible
Accounts with no open Opportunities should skipChange the no-row policy only after confirming the intended business behavior
Unable to CheckConfirm access to both objects, relationship fields, and user ID fields