Advanced 45 min read

Project: Configurable Enterprise Dashboard

By the end of this lesson, you'll be able to:

  • Drive a dashboard's displayed metrics from Custom Metadata rather than hardcoded values
  • Let an admin add or reorder dashboard tiles without a code deployment
  • Recognize where configuration-driven design genuinely pays off at enterprise scale

Prerequisites: "Project: Mobile Sales Workspace"

What We're Building

An enterpriseDashboard component whose displayed metric tiles — which ones appear, in what order, with what label — are driven entirely by Dashboard_Tile__mdt Custom Metadata records (Module 16), not hardcoded in the component.

The Apex Layer

public inherited sharing class DashboardConfigService {
    public static List<DashboardTile> getConfiguredTiles() {
        List<DashboardTile> tiles = new List<DashboardTile>();
        for (Dashboard_Tile__mdt config : [
            SELECT Label__c, Metric_Key__c, Display_Order__c
            FROM Dashboard_Tile__mdt
            WHERE IsActive__c = true
            ORDER BY Display_Order__c
        ]) {
            tiles.add(new DashboardTile(config.Label__c, config.Metric_Key__c));
        }
        return tiles;
    }
}

public with sharing class DashboardController {
    @AuraEnabled(cacheable=true)
    public static List<DashboardTile> getConfiguredTiles() {
        return DashboardConfigService.getConfiguredTiles();
    }
}

An admin can activate, deactivate, relabel, or reorder tiles entirely through Setup — no Apex change, no LWC change, no deployment required for any of that.

The Component

<div class="slds-grid slds-wrap slds-gutters">
    <template for:each={tiles} for:item="tile">
        <div key={tile.metricKey} class="slds-col slds-size_1-of-1 slds-medium-size_1-of-3">
            <div class="slds-box slds-text-align_center">
                <h3>{tile.label}</h3>
                <p class="slds-text-heading_large">{tile.value}</p>
            </div>
        </div>
    </template>
</div>

The component renders however many tiles the metadata configuration provides — zero hardcoded assumptions about which metrics exist or how many there are, exactly the "configuration for admin-tunable values" line Module 16 drew, while the actual metric calculation logic itself (not shown) still lives in real, tested Apex code, not configuration.

Exercise

Explain, as a comment, what an admin can change about this dashboard without any code deployment.

Show hint

Recall what fields the Dashboard_Tile__mdt query reads.

APEX

Exercise

Challenge: explain, as a comment, why the actual metric CALCULATION logic (not shown) should stay in Apex rather than also becoming configuration.

Show hint

Recall Module 16's "where the line is" lesson.

APEX

Project: Configurable Enterprise Dashboard Quiz

1. What drives which tiles appear on this dashboard?

2. Can an admin reorder dashboard tiles without a deployment?

3. What should NOT become configuration, according to Module 16's line-drawing principle?

4. What field controls whether a tile is shown at all?

5. What genuine benefit does this configuration-driven design provide at enterprise scale?

Log in to submit the quiz and save your score.

My Notes

Log in to keep private notes on this lesson.

Questions about this lesson

No questions yet — be the first to ask.

Log in to ask a question about this lesson.

Summary

A capstone-style dashboard whose tiles are entirely admin-configurable via Custom Metadata — applying Module 16's configuration-driven development lesson to a genuinely enterprise-scale need.