Apex Aide apexaide

Test Data Formula

By Pamela· www.freelikeapuppy.tech· ·Intermediate ·Admin ·6 min read
Summary

This content shows how to efficiently manage test data in Salesforce production orgs by creating a formula checkbox field called 'Is Test Data' that flags test contacts, leads, and related records. It addresses the common challenge of identifying and filtering diverse test records in reports and related objects by hard coding recognizable names or IDs into formula fields. This approach simplifies reporting, keeps test data organized, and enables easy visibility using reports and banners. Salesforce teams can build similar formula fields across objects to better track and manage their test records without confusion or manual report filtering.

Takeaways
  • Use a formula checkbox field to flag test data records automatically.
  • Hard code test record identifiers like names or record IDs in the formula.
  • Create formula fields on related objects to inherit the test flag via lookups.
  • Filter reports and related lists using the Is Test Data checkbox to exclude test records.
  • Add conditional Lightning banners to visually indicate test records on page layouts.

It's quite a while ago that I wrote about having test data in your production org . ( I'm still a fan.) But recently I set up an additional way to work with those test records: formula fields that designate a record as part of your test suite. My client For Pete's Sake (FPS) really needed this trick. FPS has quite a few contacts that are test records and they come from various franchises or no franchise at all because they've been created by different people at different times for slightly different reasons. That makes it pretty hard to keep track of them all. Let's just list some of who they have: Patient Homer Simpson, his wife Marge, and children Lisa, Bart, and Maggie . They went on respite several months ago. Homer and Marge share phone numbers with a couple of FPS staff so that we could test notifications asking them to complete pre and post respite surveys. Patient Wonder Woman and her caregiver Spider Man went on a later respite.

Validation & Data QualitySalesforce AdminUser Experience (UX)