Skip to content

Check whether the Account Owner is on the Account Team

Setup reference: Query Check configuration

Create a Query Check that reads Account Team Member User IDs and confirms that the Account Owner ID appears in the list.

This is a list-membership question across related records. Verify with a query can compare the Account’s Owner ID with every visible Account Team Member User ID without custom Apex.

  • Confirm Account Teams are enabled and your policy truly requires an explicit team row for the owner. Salesforce ownership alone may already provide the access your process needs.
  • Confirm intended users can read Account Owner and Account Team Members.
  • Decide which Account Team Role the owner should receive; this Check verifies membership only.
  • Save new configuration inactive and validate it before activation.

Use Account Related Record Review, 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
LabelOwner Is on Account Team
Record Health Check NameOwner_Is_On_Account_Team
Check SetAccount Related Record Review
Check TitleAccount Owner is on the Account Team
Evaluation TypeVerify with a query
Source QueryLeave blank
Comparison QuerySELECT UserId FROM AccountTeamMember WHERE AccountId = {!record.Id}
Comparison Query FieldUserId
Value to find in the list (formula)OwnerId
How To Read Query ResultsCompare as lists
Comparison OperatorList contains any
If Query Finds No RecordsFail
Max Query Rows200
Formula Result TypeAutomatic
Failure SeverityWarning
Message When FailedThe owner of {!record.Name fallback="this Account"} is not on the Account Team.
Fix MessageAdd the owner with the team role approved by your organization.
Action LabelReview account team
Action URL/lightning/r/Account/{!record.Id}/related/AccountTeamMembers/view
Evaluation Order110
ActiveUnchecked until validation succeeds

In list-membership mode, the Comparison Query supplies the list and OwnerId supplies the value to find. Leave Source Query blank.

  1. Run the configuration-validation Flow.
  2. Confirm Account Teams and the explicit-membership policy, then correct every validation error.
  3. Set the Check and Check Set to Active only after validation succeeds.
  4. Test from the Account page with Record Health Check Card User.
Visible Account TeamExpected result
No rowsWarning
Contains users other than the ownerWarning
Contains the Account OwnerPass

Repeat as a user with the access intended card users receive. The comparison uses only team rows visible to the running user.

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
Account Team related list is unavailableConfirm Account Teams are enabled
Every Account failsConfirm Source Query is blank and Comparison Query returns UserId
The wrong team role passesMembership is all this Check tests; use another rule when role matters
Unable to CheckConfirm access to OwnerId, AccountTeamMember, AccountId, and UserId