Skip to main content

Command Palette

Search for a command to run...

๐Ÿ”’ Day 3: Data Quality & Validation Rules

Published
โ€ข7 min read
๐Ÿ”’ Day 3: Data Quality & Validation Rules
C

I am a senior software developer with extensive experience in leading teams and building complex web platforms, including educational and healthcare-focused applications. I have demonstrated deep technical expertise in backend development, AI integration, and cloud technologies, which is further evidenced by my peer-reviewed publications in real-time object detection and AI. My work has earned recognition through citations and contributions to platforms indexed in Google Scholar and ResearchGate. Beyond my technical roles, I am actively involved in mentorship through ADPList and serve as an Alumni Advisory Board Member for the Generation Initiative, showcasing my commitment to advancing digital skills and cloud technology.

What I Built Today

Today I focused on data quality by implementing 6 validation rules across my Housing Operations system. These rules act as gatekeepers, preventing bad data from entering Salesforce.

The 6 Validation Rules:

  1. Tenancy End Date Logic โ€“ End date cannot be before start date

  2. Repair Completion Date Logic โ€“ Completion date cannot be before reported date

  3. Repair Status Completion โ€“ If status is "Completed", completion date must be filled

  4. Vulnerability Review Date Logic โ€“ Review date cannot be before identified date

  5. Property Year Built Logic โ€“ Year built cannot be in the future

  6. Rent Arrears Logic โ€“ Rent arrears cannot be negative


Key Learnings

1. What Are Validation Rules?

Validation rules are formulas that evaluate to TRUE or FALSE:

  • If TRUE โ†’ Error fires, record doesn't save

  • If FALSE โ†’ Record saves successfully

They're essential for:

  • Data integrity โ€“ Preventing illogical data

  • Compliance โ€“ Ensuring required fields are filled

  • User guidance โ€“ Clear error messages help users fix mistakes


2. Formula Functions I Mastered

AND() โ€“ All conditions must be true

AND(NOT(ISBLANK(End_Date__c)), End_Date__c < Start_Date__c)

Only check end date if it's filled AND it's before start date.

ISBLANK() โ€“ Check if field is empty

ISBLANK(Actual_Completion_Date__c)

Returns TRUE if completion date is blank.

ISPICKVAL() โ€“ Check picklist value

ISPICKVAL(Status__c, "Completed")

Returns TRUE if status equals "Completed".

YEAR(TODAY()) โ€“ Get current year

Year_Built__c > YEAR(TODAY())

Checks if year built is in the future.


3. The 6 Validation Rules Explained

Rule 1: Tenancy End Date Logic

Object: HOA_Tenancy__c

Formula:

AND(NOT(ISBLANK(End_Date__c)), End_Date__c < Start_Date__c)

Why it matters:

  • Prevents illogical tenancy durations

  • Ensures accurate reporting on tenancy lengths

  • Critical for rent calculation and arrears tracking

Error Message: "End Date cannot be before Start Date."


Rule 2: Repair Completion Date Logic

Object: HOA_Repair_Request__c

Formula:

AND(NOT(ISBLANK(Actual_Completion_Date__c)), Actual_Completion_Date__c < Reported_Date__c)

Why it matters:

  • Ensures accurate SLA tracking

  • Prevents time-travel data entry errors

  • Essential for performance reporting to board

Error Message: "Actual Completion Date cannot be before Reported Date."


Rule 3: Completed Status Requires Date

Object: HOA_Repair_Request__c

Formula:

AND(ISPICKVAL(Status__c, "Completed"), ISBLANK(Actual_Completion_Date__c))

Why it matters:

  • Prevents marking repairs as complete without recording when

  • Ensures complete data for SLA reporting

  • Critical for contractor performance tracking

Error Message: "You must enter an Actual Completion Date when Status is Completed."


Rule 4: Vulnerability Review Date Logic

Object: HOA_Vulnerability__c

Formula:

AND(NOT(ISBLANK(Review_Date__c)), Review_Date__c < Identified_Date__c)

Why it matters:

  • Maintains audit trail for safeguarding compliance

  • Ensures reviews happen in logical sequence

  • Critical for regulatory inspections

Error Message: "Review Date cannot be before Identified Date."


Rule 5: Property Year Built Logic

Object: HOA_Property__c

Formula:

Year_Built__c > YEAR(TODAY())

Why it matters:

  • Prevents data entry errors

  • Ensures property age calculations are accurate

  • Important for maintenance planning (older properties need more repairs)

Error Message: "Year Built cannot be in the future."


Rule 6: Rent Arrears Logic

Object: HOA_Tenancy__c

Formula:

Rent_Arrears__c < 0

Why it matters:

  • Prevents financial data errors

  • Ensures accurate arrears reporting

  • Protects financial integrity of the system

Error Message: "Rent Arrears cannot be negative. If tenant has overpaid, please contact Finance team."


4. Testing Is Critical!

I tested each validation rule with:

  • Invalid data โ€“ Confirmed error messages appear

  • Valid data โ€“ Confirmed records save successfully

  • Edge cases โ€“ Blank values, boundary conditions

Example Test: Tenancy End Date Validation

Test Scenario: Create a tenancy with end date before start date.

Steps:

  1. Go to Housing Operations app โ†’ Tenancies

  2. Click New

  3. Fill in:

    • Start Date: 01/01/2024

    • End Date: 01/12/2023 (before start!)

  4. Click Save

Result: โœ… Error appeared: "End Date cannot be before Start Date."

Test Scenario 2: Create tenancy with blank end date (should work).

Result: โœ… Record saved successfully (blank end date is allowed for active tenancies)


Example Test: Completed Status Requires Date

Test Scenario: Mark repair as "Completed" without filling completion date.

Steps:

  1. Go to Housing Operations app โ†’ Repair Requests

  2. Click New

  3. Fill in:

    • Reported Date: Today

    • Issue Description: "Leaking tap"

    • Status: Completed

    • Actual Completion Date: Leave blank

  4. Click Save

Result: โœ… Error appeared: "You must enter an Actual Completion Date when Status is Completed."


Screenshots

  1. Validation Rules List for Tenancy โ€“ Setup โ†’ Object Manager โ†’ Tenancy โ†’ Validation Rules (showing both rules)

  2. End Date Validation Rule Setup โ€“ The full configuration page for End_Date_Before_Start_Date

  3. Validation Rules List for Repair Request โ€“ Showing both repair-related rules

  4. Completed Status Validation Rule Setup โ€“ The full configuration for Completed_Status_Requires_Date

  5. Vulnerability Validation Rule Setup โ€“ The full configuration for Review_Date_Before_Identified_Date

  6. Property Validation Rule Setup โ€“ The full configuration for Year_Built_In_Future

  7. Error Message in Action โ€“ Screenshot of validation rule firing (showing the error message on screen)

  8. All Validation Rules Summary โ€“ A document showing all 6 rules created


Challenges I Faced

1. Formula Syntax

Getting AND() and NOT() nested correctly took a few tries. I learned that:

  • Parentheses must be balanced

  • Each function needs its arguments in the right order

  • NOT(ISBLANK()) is different from ISBLANK() = FALSE

2. ISPICKVAL vs TEXT

Learned that ISPICKVAL() is the correct function for picklists, not TEXT(). Using TEXT(Status__c) = "Completed" would work but ISPICKVAL() is best practice.

3. Testing Edge Cases

Had to think through scenarios like:

  • What if end date is blank? (should be allowed for active tenancies)

  • What if both dates are the same? (should be allowed)

  • What if user changes status from Completed to In Progress? (completion date can remain filled)

4. Error Message Clarity

Wrote user-friendly messages that explain HOW to fix the error, not just what's wrong.

Bad: "Invalid date." Good: "End Date cannot be before Start Date." Better: "Rent Arrears cannot be negative. If tenant has overpaid, please contact Finance team." (provides next steps)


Real-World Impact for Incommunities

These 6 validation rules will:

Data Quality

  • Reduce data entry errors by 80%+ (based on industry benchmarks)

  • Improve reporting accuracy โ€“ No more illogical dates breaking reports

  • Prevent financial errors โ€“ Negative arrears can't be entered

Compliance

  • Ensure audit trails โ€“ Safeguarding reviews have logical sequence

  • Meet regulatory requirements โ€“ Data integrity for inspections

  • Support legal cases โ€“ Accurate tenancy dates for disputes

Operational Efficiency

  • Save time โ€“ Staff won't have to manually check for data errors

  • Reduce support tickets โ€“ Clear error messages guide users

  • Enable automation โ€“ Clean data allows for reliable automated processes

Trust & Confidence

  • Build trust โ€“ Managers can trust the data in the system

  • Improve decision-making โ€“ Reports based on accurate data

  • Professional image โ€“ System enforces business rules consistently


What I Learned About the Salesforce Admin Role

Today's work directly aligns with the Salesforce Administrator role at Incommunities:

From the Job Spec:

"Ensure data quality and integrity across the Salesforce platform"

How validation rules deliver this:

  • Prevent bad data at the point of entry

  • Enforce business rules consistently

  • Maintain data standards across all users

From the Job Spec:

"Configure Salesforce to meet business requirements"

How validation rules deliver this:

  • Translate business rules into technical configuration

  • Balance data quality with user experience

  • Document rules for future reference

From the Job Spec:

"Support users and resolve issues"

How validation rules deliver this:

  • Clear error messages reduce support tickets

  • Prevent issues before they happen

  • Guide users to correct data entry


Tomorrow: Day 4

I'll dive into Formula Fields โ€“ creating calculated fields that automatically compute values based on other fields. This will include:

  • Text formulas

  • Number formulas

  • Date formulas

  • Conditional logic (IF statements)

Looking forward to making the system even smarter! ๐Ÿง 


Resources


Progress Tracker

โœ… Day 1: Data Modeling & ERD

โœ… Day 2: Custom Objects & Fields

โœ… Day 3: Data Quality & Validation Rules

โฌœ Day 4: Formula Fields

โฌœ Day 5: Security & Access

โฌœ Day 6: Automation (Flow)

โฌœ Day 7: Reports & Dashboards

โฌœ Day 8: Data Management

โฌœ Day 9: Integration Basics

โฌœ Day 10: Final Project & Review


Follow my journey:

#Salesforce #SalesforceAdmin #LearningInPublic #Day3 #DataQuality #ValidationRules #HousingAssociation #Incommunities