Check that the billing address is complete
Create a Record Health Check that passes only when an Account’s Billing City, Billing State, and Billing Country are all populated. When a part is missing, the card names it in Found, so the user knows what to add. The example uses the Verify with a formula Evaluation Type.
Why a formula fits
Section titled “Why a formula fits”All three values are fields on the Account that is open, so one Salesforce formula can require them together. Use a Check rather than a Validation Rule because an incomplete address should be fixed before tax or territory review, not block every other Account update.
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 the people who will use the card can read Billing City, Billing State, and Billing Country.
- If your org uses State and Country/Territory Picklists, decide whether the formula should use
BillingStateCodeandBillingCountryCodeinstead. Both pairs are available in those orgs. - Add Billing Street or Billing Zip/Postal Code to the formula if your process requires them.
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 Data Quality |
| Object | Account |
| Record Health Check Set Name | Account_ |
| Active | Cleared until validation succeeds |
| Card Title | Account Data Quality |
| Card Subtitle | Confirm the billing address is complete for tax and territory review. |
| 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 | Billing Address Is Complete |
| Check Set | Account Data Quality |
| Evaluation Type | Verify with a formula |
| Record Health Check Name | Billing_ |
| Evaluation Order | 20 |
| Active | Cleared until validation succeeds |
| Pass Condition | AND(NOT(ISBLANK(BillingCity)), NOT(ISBLANK(BillingState)), NOT(ISBLANK(BillingCountry))) |
| Check Title | Billing address is complete |
| Check Description | Passes when Billing City, Billing State, and Billing Country are all populated. |
| Message When Failed | {!record. |
| Fix Message | Add each billing address part named in Found, then run the Check again. |
| Failure Severity | Critical |
| Action Label | Edit billing address |
| Action URL | /lightning/r/Account/{!record. |
| Display: Found Formula | IF(ISBLANK(BillingCity), "City missing. |
| Display: Expected Formula | "City, State, and Country populated" |
How the formulas work:
- Pass Condition decides the result.
AND()is true only when all threeNOT(ISBLANK())tests are true. - Display: Found Formula only builds the text the card shows.
IF()adds a phrase for each missing part, and&joins the phrases. On a complete address it returns no text. - Display: Expected Formula is fixed text, written in quotation marks because it is a formula.
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 Data Quality (Account_Data_Quality), 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”Use sandbox Accounts that you can edit. Select Run on the card for each case.
| Billing City | Billing State | Billing Country | Result on the card | Found |
|---|---|---|---|---|
| Populated | Populated | Populated | Pass | No value, because nothing is missing |
| Blank | Populated | Populated | Failed | City missing. |
| Populated | Blank | Blank | Failed | State missing. Country missing. |
The label is Failed because Failure Severity is Critical. Run one failing case as a user who cannot read Billing Country; the row shows Unable to Check.
What users see
Section titled “What users see”A failed row shows Failed, the message with the Account Name, the fix message, an Edit billing address link, and Found and Expected values. With Found/Expected Display set to Show on demand, failed rows show Found and Expected without any action from the user.
Resolve problems
Section titled “Resolve problems”| What you see | What to check |
|---|---|
| A complete address fails | Whether your org stores State and Country in BillingStateCode and BillingCountryCode instead. |
| Found does not name every missing part | The Display: Found Formula matches the table exactly, including every quotation mark. |
| Unable to Check | The user can read all three address fields. |
| The Check Set is not in Lightning App Builder | The Check Set is active and its Object is Account. |