From 0972d22127f8d340aed3a18ee18fbaae503be00c Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 10 Jul 2026 18:31:14 +0000 Subject: [PATCH 1/3] Add NZC Lightning report types, summary report, and dashboard metadata Unmanaged SFDX package (API 60.0) with five custom report types over standard Net Zero Cloud objects, a summary report of stationary assets missing carbon footprints, and a dashboard with a bar chart component. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01XsipTUqX7dcQDkvUkaFCuC --- .gitignore | 6 ++ README.md | 67 +++++++++++++++- .../NZC_Dashboards.dashboardFolder-meta.xml | 4 + .../NZC_Emissions_Coverage.dashboard-meta.xml | 36 +++++++++ ...thout_Supplier_Metrics.reportType-meta.xml | 58 ++++++++++++++ ...rints_with_Energy_Uses.reportType-meta.xml | 68 ++++++++++++++++ ...lone_Carbon_Footprints.reportType-meta.xml | 51 ++++++++++++ ...ndalone_Vehicle_Assets.reportType-meta.xml | 31 ++++++++ ...hout_Carbon_Footprints.reportType-meta.xml | 78 +++++++++++++++++++ .../reports/NZC_Reports.reportFolder-meta.xml | 4 + ..._Assets_Missing_Footprints.report-meta.xml | 38 +++++++++ manifest/package.xml | 22 ++++++ sfdx-project.json | 12 +++ 13 files changed, 474 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 force-app/main/default/dashboards/NZC_Dashboards.dashboardFolder-meta.xml create mode 100644 force-app/main/default/dashboards/NZC_Dashboards/NZC_Emissions_Coverage.dashboard-meta.xml create mode 100644 force-app/main/default/reportTypes/Accounts_with_or_without_Supplier_Metrics.reportType-meta.xml create mode 100644 force-app/main/default/reportTypes/Footprints_with_Energy_Uses.reportType-meta.xml create mode 100644 force-app/main/default/reportTypes/Standalone_Carbon_Footprints.reportType-meta.xml create mode 100644 force-app/main/default/reportTypes/Standalone_Vehicle_Assets.reportType-meta.xml create mode 100644 force-app/main/default/reportTypes/Stationary_Assets_with_without_Carbon_Footprints.reportType-meta.xml create mode 100644 force-app/main/default/reports/NZC_Reports.reportFolder-meta.xml create mode 100644 force-app/main/default/reports/NZC_Reports/Stationary_Assets_Missing_Footprints.report-meta.xml create mode 100644 manifest/package.xml create mode 100644 sfdx-project.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cbb8522 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +.sf/ +.sfdx/ +.localdevserver/ +deploy-options.json +node_modules/ +.DS_Store diff --git a/README.md b/README.md index 005cab2..11c9879 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,67 @@ # nzc-customreports -This package will provide custom reports types to build salesforce lightning reports for Net Zero Cloud + +A free, unmanaged, open-source package of basic **Lightning Report Types, Reports, and Dashboards** for **Salesforce Net Zero Cloud** (core Lightning analytics only — no CRM Analytics / Einstein components). Metadata API version **60.0**. + +## What's included + +| Component | API Name | Details | +|---|---|---| +| Custom Report Type | `Stationary_Assets_with_without_Carbon_Footprints` | `StnryAsstEnvrSrc` with/without `StnryAsstCrbnFprint` (outer join) | +| Custom Report Type | `Footprints_with_Energy_Uses` | `StnryAsstCrbnFprint` with `StnryAsstFossilFuelEnrgyUse` (inner join) | +| Custom Report Type | `Accounts_with_or_without_Supplier_Metrics` | `Account` with/without `SpplrMtrc` (outer join) | +| Custom Report Type | `Standalone_Carbon_Footprints` | Single object: `StnryAsstCrbnFprint` | +| Custom Report Type | `Standalone_Vehicle_Assets` | Single object: `VehicleAsset` | +| Report | `NZC_Reports/Stationary_Assets_Missing_Footprints` | Summary report grouped by asset type (record type), filtered to rows where the related Carbon Footprint Id is blank | +| Dashboard | `NZC_Dashboards/NZC_Emissions_Coverage` | Bar chart of assets missing carbon footprints, by asset type | + +All report type layouts are curated to the fields sustainability teams use most (asset name, reporting year, stage, Scope 1 / Scope 2 emissions (tCO2e), fuel type, record type), and every curated column is flagged `checkedByDefault` so it is pre-selected when users build a new report. + +> **Note:** The first report type's label is "Stationary Assets with/without Carbon Footprints" (rather than "…with or without…") to stay within the 50-character report type label limit. + +## Project structure + +``` +manifest/package.xml +force-app/main/default/ +├── reportTypes/ +│ ├── Stationary_Assets_with_without_Carbon_Footprints.reportType-meta.xml +│ ├── Footprints_with_Energy_Uses.reportType-meta.xml +│ ├── Accounts_with_or_without_Supplier_Metrics.reportType-meta.xml +│ ├── Standalone_Carbon_Footprints.reportType-meta.xml +│ └── Standalone_Vehicle_Assets.reportType-meta.xml +├── reports/ +│ ├── NZC_Reports.reportFolder-meta.xml +│ └── NZC_Reports/Stationary_Assets_Missing_Footprints.report-meta.xml +└── dashboards/ + ├── NZC_Dashboards.dashboardFolder-meta.xml + └── NZC_Dashboards/NZC_Emissions_Coverage.dashboard-meta.xml +``` + +## Prerequisites + +- A Salesforce org with the **Net Zero Cloud** license and managed objects enabled (`StnryAsstEnvrSrc`, `StnryAsstCrbnFprint`, `StnryAsstFossilFuelEnrgyUse`, `SpplrMtrc`, `VehicleAsset`). +- Salesforce CLI (`sf`). + +## Deploy + +```bash +sf project deploy start --manifest manifest/package.xml --target-org +``` + +## Validating API names against your org + +Net Zero Cloud field and child-relationship API names can vary slightly by release and license edition. If a deploy fails on a field or relationship name, verify the exact names in your org and adjust the XML: + +```bash +sf sobject describe --sobject StnryAsstCrbnFprint --target-org | jq '.fields[].name' +sf sobject describe --sobject StnryAsstEnvrSrc --target-org | jq '.childRelationships[] | {relationshipName, childSObject}' +``` + +The most likely candidates to need adjustment: + +- Child relationship names used in the report type joins: `StnryAsstCrbnFprints`, `StnryAsstFossilFuelEnrgyUses`, `SpplrMtrcs`. +- Emissions field spellings on `StnryAsstCrbnFprint` (e.g. `TotalScope2LocationBasedEmissions` / `TotalScope2MarketBasedEmissions`) and metric fields on `SpplrMtrc`. + +## License + +Free to use, modify, and redistribute. diff --git a/force-app/main/default/dashboards/NZC_Dashboards.dashboardFolder-meta.xml b/force-app/main/default/dashboards/NZC_Dashboards.dashboardFolder-meta.xml new file mode 100644 index 0000000..ef7f354 --- /dev/null +++ b/force-app/main/default/dashboards/NZC_Dashboards.dashboardFolder-meta.xml @@ -0,0 +1,4 @@ + + + NZC Dashboards + diff --git a/force-app/main/default/dashboards/NZC_Dashboards/NZC_Emissions_Coverage.dashboard-meta.xml b/force-app/main/default/dashboards/NZC_Dashboards/NZC_Emissions_Coverage.dashboard-meta.xml new file mode 100644 index 0000000..ec2acd5 --- /dev/null +++ b/force-app/main/default/dashboards/NZC_Dashboards/NZC_Emissions_Coverage.dashboard-meta.xml @@ -0,0 +1,36 @@ + + + #FFFFFF + Diagonal + #FFFFFF + LoggedInUser + Net Zero Cloud emissions data-coverage overview. Highlights stationary assets that are missing carbon footprint records. + false + + Medium + + true + Auto + Bar + Auto + false + false + true + true +
Data Coverage
+ Bottom + NZC_Reports/Stationary_Assets_Missing_Footprints + false + false + true + RowValueDescending + Assets Missing Carbon Footprints by Asset Type + false +
+
+ + Medium + + #000000 + NZC Emissions Coverage +
diff --git a/force-app/main/default/reportTypes/Accounts_with_or_without_Supplier_Metrics.reportType-meta.xml b/force-app/main/default/reportTypes/Accounts_with_or_without_Supplier_Metrics.reportType-meta.xml new file mode 100644 index 0000000..720f3e6 --- /dev/null +++ b/force-app/main/default/reportTypes/Accounts_with_or_without_Supplier_Metrics.reportType-meta.xml @@ -0,0 +1,58 @@ + + + Account + accounts + true + Accounts with or without related Supplier Metric records (outer join). Use this report type to find suppliers that have not yet disclosed emissions data. + + true + SpplrMtrcs + + + + + true + Name + Account
+
+ + true + Industry + Account
+
+ + true + BillingCountry + Account
+
+ Accounts +
+ + + true + Name + Account.SpplrMtrcs
+
+ + true + ReportingYear + Account.SpplrMtrcs
+
+ + true + Scope1Emissions + Account.SpplrMtrcs
+
+ + true + Scope2Emissions + Account.SpplrMtrcs
+
+ + true + Scope3Emissions + Account.SpplrMtrcs
+
+ Supplier Metrics +
+
diff --git a/force-app/main/default/reportTypes/Footprints_with_Energy_Uses.reportType-meta.xml b/force-app/main/default/reportTypes/Footprints_with_Energy_Uses.reportType-meta.xml new file mode 100644 index 0000000..50def91 --- /dev/null +++ b/force-app/main/default/reportTypes/Footprints_with_Energy_Uses.reportType-meta.xml @@ -0,0 +1,68 @@ + + + StnryAsstCrbnFprint + other + true + Stationary Asset Carbon Footprints with related Stationary Asset Fossil Fuel Energy Use records (inner join). Use this report type to analyze fuel consumption behind each footprint. + + false + StnryAsstFossilFuelEnrgyUses + + + + + true + Name + StnryAsstCrbnFprint
+
+ + true + ReportingYear + StnryAsstCrbnFprint
+
+ + true + Stage + StnryAsstCrbnFprint
+
+ + true + TotalScope1Emissions + StnryAsstCrbnFprint
+
+ + true + TotalScope2LocationBasedEmissions + StnryAsstCrbnFprint
+
+ + true + TotalScope2MarketBasedEmissions + StnryAsstCrbnFprint
+
+ Stationary Asset Carbon Footprints +
+ + + true + Name + StnryAsstCrbnFprint.StnryAsstFossilFuelEnrgyUses
+
+ + true + FuelType + StnryAsstCrbnFprint.StnryAsstFossilFuelEnrgyUses
+
+ + true + FuelConsumption + StnryAsstCrbnFprint.StnryAsstFossilFuelEnrgyUses
+
+ + true + FuelConsumptionUnit + StnryAsstCrbnFprint.StnryAsstFossilFuelEnrgyUses
+
+ Fossil Fuel Energy Uses +
+
diff --git a/force-app/main/default/reportTypes/Standalone_Carbon_Footprints.reportType-meta.xml b/force-app/main/default/reportTypes/Standalone_Carbon_Footprints.reportType-meta.xml new file mode 100644 index 0000000..6159e5d --- /dev/null +++ b/force-app/main/default/reportTypes/Standalone_Carbon_Footprints.reportType-meta.xml @@ -0,0 +1,51 @@ + + + StnryAsstCrbnFprint + other + true + Single-object report type over Stationary Asset Carbon Footprints. Use this report type for footprint-only rollups such as total emissions by reporting year or stage. + + + + true + Name + StnryAsstCrbnFprint
+
+ + true + StnryAsstEnvrSrc + StnryAsstCrbnFprint
+
+ + true + ReportingYear + StnryAsstCrbnFprint
+
+ + true + Stage + StnryAsstCrbnFprint
+
+ + true + TotalScope1Emissions + StnryAsstCrbnFprint
+
+ + true + TotalScope2LocationBasedEmissions + StnryAsstCrbnFprint
+
+ + true + TotalScope2MarketBasedEmissions + StnryAsstCrbnFprint
+
+ + true + TotalCarbonFootprint + StnryAsstCrbnFprint
+
+ Stationary Asset Carbon Footprints +
+
diff --git a/force-app/main/default/reportTypes/Standalone_Vehicle_Assets.reportType-meta.xml b/force-app/main/default/reportTypes/Standalone_Vehicle_Assets.reportType-meta.xml new file mode 100644 index 0000000..fd1a851 --- /dev/null +++ b/force-app/main/default/reportTypes/Standalone_Vehicle_Assets.reportType-meta.xml @@ -0,0 +1,31 @@ + + + VehicleAsset + other + true + Single-object report type over Vehicle Assets. Use this report type to inventory fleet vehicles by vehicle type and fuel type for Scope 1 mobile combustion tracking. + + + + true + Name + VehicleAsset
+
+ + true + VehicleType + VehicleAsset
+
+ + true + FuelType + VehicleAsset
+
+ + true + CreatedDate + VehicleAsset
+
+ Vehicle Assets +
+
diff --git a/force-app/main/default/reportTypes/Stationary_Assets_with_without_Carbon_Footprints.reportType-meta.xml b/force-app/main/default/reportTypes/Stationary_Assets_with_without_Carbon_Footprints.reportType-meta.xml new file mode 100644 index 0000000..ebfcbe1 --- /dev/null +++ b/force-app/main/default/reportTypes/Stationary_Assets_with_without_Carbon_Footprints.reportType-meta.xml @@ -0,0 +1,78 @@ + + + StnryAsstEnvrSrc + other + true + Stationary Asset Environmental Sources with or without related Stationary Asset Carbon Footprints (outer join). Use this report type to find assets that are missing carbon footprint records. + + true + StnryAsstCrbnFprints + + + + + true + Name + StnryAsstEnvrSrc
+
+ + true + RecordType + StnryAsstEnvrSrc
+
+ + true + BusinessRegion + StnryAsstEnvrSrc
+
+ + true + City + StnryAsstEnvrSrc
+
+ + true + Country + StnryAsstEnvrSrc
+
+ Stationary Asset Environmental Sources +
+ + + true + Name + StnryAsstEnvrSrc.StnryAsstCrbnFprints
+
+ + true + ReportingYear + StnryAsstEnvrSrc.StnryAsstCrbnFprints
+
+ + true + Stage + StnryAsstEnvrSrc.StnryAsstCrbnFprints
+
+ + true + TotalScope1Emissions + StnryAsstEnvrSrc.StnryAsstCrbnFprints
+
+ + true + TotalScope2LocationBasedEmissions + StnryAsstEnvrSrc.StnryAsstCrbnFprints
+
+ + true + TotalScope2MarketBasedEmissions + StnryAsstEnvrSrc.StnryAsstCrbnFprints
+
+ + true + TotalCarbonFootprint + StnryAsstEnvrSrc.StnryAsstCrbnFprints
+
+ Stationary Asset Carbon Footprints +
+
diff --git a/force-app/main/default/reports/NZC_Reports.reportFolder-meta.xml b/force-app/main/default/reports/NZC_Reports.reportFolder-meta.xml new file mode 100644 index 0000000..7715863 --- /dev/null +++ b/force-app/main/default/reports/NZC_Reports.reportFolder-meta.xml @@ -0,0 +1,4 @@ + + + NZC Reports + diff --git a/force-app/main/default/reports/NZC_Reports/Stationary_Assets_Missing_Footprints.report-meta.xml b/force-app/main/default/reports/NZC_Reports/Stationary_Assets_Missing_Footprints.report-meta.xml new file mode 100644 index 0000000..6f7f999 --- /dev/null +++ b/force-app/main/default/reports/NZC_Reports/Stationary_Assets_Missing_Footprints.report-meta.xml @@ -0,0 +1,38 @@ + + + + StnryAsstEnvrSrc$Name + + + StnryAsstEnvrSrc$BusinessRegion + + + StnryAsstEnvrSrc$City + + + StnryAsstEnvrSrc$Country + + Stationary Asset Environmental Sources that have no related Stationary Asset Carbon Footprint record, grouped by asset type (record type). Data-completeness check for the emissions inventory. + + + StnryAsstEnvrSrc.StnryAsstCrbnFprints$Id + true + equals + + + + Summary + + Day + StnryAsstEnvrSrc$RecordType + Asc + + Stationary Assets Missing Footprints + Stationary_Assets_with_without_Carbon_Footprints + organization + true + + StnryAsstEnvrSrc$CreatedDate + INTERVAL_CUSTOM + + diff --git a/manifest/package.xml b/manifest/package.xml new file mode 100644 index 0000000..988498d --- /dev/null +++ b/manifest/package.xml @@ -0,0 +1,22 @@ + + + + Stationary_Assets_with_without_Carbon_Footprints + Footprints_with_Energy_Uses + Accounts_with_or_without_Supplier_Metrics + Standalone_Carbon_Footprints + Standalone_Vehicle_Assets + ReportType + + + NZC_Reports + NZC_Reports/Stationary_Assets_Missing_Footprints + Report + + + NZC_Dashboards + NZC_Dashboards/NZC_Emissions_Coverage + Dashboard + + 60.0 + diff --git a/sfdx-project.json b/sfdx-project.json new file mode 100644 index 0000000..db73c89 --- /dev/null +++ b/sfdx-project.json @@ -0,0 +1,12 @@ +{ + "packageDirectories": [ + { + "path": "force-app", + "default": true + } + ], + "name": "nzc-customreports", + "namespace": "", + "sfdcLoginUrl": "https://login.salesforce.com", + "sourceApiVersion": "60.0" +} From 4812d66d9f3b6b59db83607cbb000e497a0589d2 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 10 Jul 2026 18:40:51 +0000 Subject: [PATCH 2/3] Add example reports for all report types, expanded dashboard, CI, and project hygiene - One example report per report type: fuel consumption by fuel type, suppliers missing metrics, emissions by reporting year (summed scope fields), and fleet by fuel type - Dashboard expanded to three columns: coverage bars, emissions trend column chart, fleet donut - GitHub Actions workflow validating XML well-formedness, SFDX source conversion, and manifest/source consistency - MIT license, .forceignore, README updates Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01XsipTUqX7dcQDkvUkaFCuC --- .forceignore | 6 ++ .github/workflows/validate.yml | 76 +++++++++++++++++++ LICENSE | 21 +++++ README.md | 23 +++++- .../NZC_Emissions_Coverage.dashboard-meta.xml | 62 ++++++++++++++- ...missions_by_Reporting_Year.report-meta.xml | 40 ++++++++++ .../Fleet_by_Fuel_Type.report-meta.xml | 24 ++++++ ...l_Consumption_by_Fuel_Type.report-meta.xml | 34 +++++++++ .../Suppliers_Missing_Metrics.report-meta.xml | 32 ++++++++ manifest/package.xml | 4 + 10 files changed, 319 insertions(+), 3 deletions(-) create mode 100644 .forceignore create mode 100644 .github/workflows/validate.yml create mode 100644 LICENSE create mode 100644 force-app/main/default/reports/NZC_Reports/Emissions_by_Reporting_Year.report-meta.xml create mode 100644 force-app/main/default/reports/NZC_Reports/Fleet_by_Fuel_Type.report-meta.xml create mode 100644 force-app/main/default/reports/NZC_Reports/Fuel_Consumption_by_Fuel_Type.report-meta.xml create mode 100644 force-app/main/default/reports/NZC_Reports/Suppliers_Missing_Metrics.report-meta.xml diff --git a/.forceignore b/.forceignore new file mode 100644 index 0000000..d011711 --- /dev/null +++ b/.forceignore @@ -0,0 +1,6 @@ +# Exclude the manifest from source tracking operations +package.xml + +# LWC/Aura config files (none in this project, kept for convention) +**/jsconfig.json +**/.eslintrc.json diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml new file mode 100644 index 0000000..cdbd54a --- /dev/null +++ b/.github/workflows/validate.yml @@ -0,0 +1,76 @@ +name: Validate metadata + +on: + push: + branches: [main] + pull_request: + +jobs: + validate: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Check XML well-formedness + run: | + python3 - <<'EOF' + import glob, sys, xml.dom.minidom + failures = [] + files = glob.glob('force-app/**/*.xml', recursive=True) + glob.glob('manifest/*.xml') + for path in sorted(files): + try: + xml.dom.minidom.parse(path) + print(f'OK {path}') + except Exception as exc: + failures.append((path, exc)) + print(f'FAIL {path}: {exc}') + sys.exit(1 if failures else 0) + EOF + + - uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Install Salesforce CLI + run: npm install --global @salesforce/cli + + - name: Convert source (validates SFDX project structure) + run: sf project convert source --output-dir mdapi-out + + - name: Verify manifest members exist in source + run: | + python3 - <<'EOF' + import sys, xml.etree.ElementTree as ET + from pathlib import Path + + NS = {'m': 'http://soap.sforce.com/2006/04/metadata'} + SUFFIX = { + 'ReportType': ('force-app/main/default/reportTypes', '.reportType-meta.xml'), + 'Report': ('force-app/main/default/reports', '.report-meta.xml'), + 'Dashboard': ('force-app/main/default/dashboards', '.dashboard-meta.xml'), + } + FOLDER_SUFFIX = { + 'Report': '.reportFolder-meta.xml', + 'Dashboard': '.dashboardFolder-meta.xml', + } + + tree = ET.parse('manifest/package.xml') + missing = [] + for t in tree.getroot().findall('m:types', NS): + name = t.find('m:name', NS).text + if name not in SUFFIX: + continue + base, suffix = SUFFIX[name] + for member in t.findall('m:members', NS): + value = member.text + candidates = [Path(base) / (value + suffix)] + if '/' not in value and name in FOLDER_SUFFIX: + candidates.append(Path(base) / (value + FOLDER_SUFFIX[name])) + if not any(c.is_file() for c in candidates): + missing.append(f'{name}: {value}') + if missing: + print('Manifest members with no matching source file:') + print('\n'.join(missing)) + sys.exit(1) + print('All manifest members have matching source files.') + EOF diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8b1bfdb --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 nzc-customreports contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 11c9879..2fc7906 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,11 @@ A free, unmanaged, open-source package of basic **Lightning Report Types, Report | Custom Report Type | `Standalone_Carbon_Footprints` | Single object: `StnryAsstCrbnFprint` | | Custom Report Type | `Standalone_Vehicle_Assets` | Single object: `VehicleAsset` | | Report | `NZC_Reports/Stationary_Assets_Missing_Footprints` | Summary report grouped by asset type (record type), filtered to rows where the related Carbon Footprint Id is blank | -| Dashboard | `NZC_Dashboards/NZC_Emissions_Coverage` | Bar chart of assets missing carbon footprints, by asset type | +| Report | `NZC_Reports/Fuel_Consumption_by_Fuel_Type` | Summary report grouped by fuel type, with summed fuel consumption | +| Report | `NZC_Reports/Suppliers_Missing_Metrics` | Accounts with no Supplier Metric record, grouped by industry | +| Report | `NZC_Reports/Emissions_by_Reporting_Year` | Footprints grouped by reporting year with summed Scope 1 / Scope 2 / total emissions | +| Report | `NZC_Reports/Fleet_by_Fuel_Type` | Vehicle assets grouped by fuel type | +| Dashboard | `NZC_Dashboards/NZC_Emissions_Coverage` | Bar charts for asset/supplier data gaps, column chart of emissions by year, donut of fleet by fuel type | All report type layouts are curated to the fields sustainability teams use most (asset name, reporting year, stage, Scope 1 / Scope 2 emissions (tCO2e), fuel type, record type), and every curated column is flagged `checkedByDefault` so it is pre-selected when users build a new report. @@ -31,12 +35,27 @@ force-app/main/default/ │ └── Standalone_Vehicle_Assets.reportType-meta.xml ├── reports/ │ ├── NZC_Reports.reportFolder-meta.xml -│ └── NZC_Reports/Stationary_Assets_Missing_Footprints.report-meta.xml +│ └── NZC_Reports/ +│ ├── Stationary_Assets_Missing_Footprints.report-meta.xml +│ ├── Fuel_Consumption_by_Fuel_Type.report-meta.xml +│ ├── Suppliers_Missing_Metrics.report-meta.xml +│ ├── Emissions_by_Reporting_Year.report-meta.xml +│ └── Fleet_by_Fuel_Type.report-meta.xml └── dashboards/ ├── NZC_Dashboards.dashboardFolder-meta.xml └── NZC_Dashboards/NZC_Emissions_Coverage.dashboard-meta.xml ``` +## Continuous integration + +Every push and pull request runs `.github/workflows/validate.yml`, which: + +1. Checks that every XML file is well-formed. +2. Runs `sf project convert source` to validate the SFDX project structure and metadata file suffixes (no org required). +3. Cross-checks that every member listed in `manifest/package.xml` has a matching source file. + +Deploy-time validation against a real Net Zero Cloud org (field and relationship API names) still needs to be done with `sf project deploy start --dry-run` against your own org, since those objects require the NZC license. + ## Prerequisites - A Salesforce org with the **Net Zero Cloud** license and managed objects enabled (`StnryAsstEnvrSrc`, `StnryAsstCrbnFprint`, `StnryAsstFossilFuelEnrgyUse`, `SpplrMtrc`, `VehicleAsset`). diff --git a/force-app/main/default/dashboards/NZC_Dashboards/NZC_Emissions_Coverage.dashboard-meta.xml b/force-app/main/default/dashboards/NZC_Dashboards/NZC_Emissions_Coverage.dashboard-meta.xml index ec2acd5..35f312e 100644 --- a/force-app/main/default/dashboards/NZC_Dashboards/NZC_Emissions_Coverage.dashboard-meta.xml +++ b/force-app/main/default/dashboards/NZC_Dashboards/NZC_Emissions_Coverage.dashboard-meta.xml @@ -4,7 +4,7 @@ Diagonal #FFFFFF LoggedInUser - Net Zero Cloud emissions data-coverage overview. Highlights stationary assets that are missing carbon footprint records. + Net Zero Cloud emissions overview: data coverage gaps for stationary assets and suppliers, emissions trend by reporting year, and fleet composition. false Medium @@ -27,10 +27,70 @@ Assets Missing Carbon Footprints by Asset Type false + + true + Auto + Bar + Auto + false + false + true + true +
Data Coverage
+ Bottom + NZC_Reports/Suppliers_Missing_Metrics + false + false + true + RowValueDescending + Suppliers Missing Metrics by Industry + false +
Medium + + true + Auto + Column + Auto + false + false + true + true +
Emissions Trend
+ Bottom + NZC_Reports/Emissions_by_Reporting_Year + false + false + true + RowLabelAscending + Total Emissions by Reporting Year (tCO2e) + false +
+ + Medium + + true + Auto + Donut + Auto + false + false + true + true +
Fleet
+ Bottom + NZC_Reports/Fleet_by_Fuel_Type + true + true + true + RowValueDescending + Vehicle Assets by Fuel Type + false +
+
#000000 NZC Emissions Coverage diff --git a/force-app/main/default/reports/NZC_Reports/Emissions_by_Reporting_Year.report-meta.xml b/force-app/main/default/reports/NZC_Reports/Emissions_by_Reporting_Year.report-meta.xml new file mode 100644 index 0000000..c22f549 --- /dev/null +++ b/force-app/main/default/reports/NZC_Reports/Emissions_by_Reporting_Year.report-meta.xml @@ -0,0 +1,40 @@ + + + + StnryAsstCrbnFprint$Name + + + StnryAsstCrbnFprint$Stage + + + Sum + StnryAsstCrbnFprint$TotalScope1Emissions + + + Sum + StnryAsstCrbnFprint$TotalScope2LocationBasedEmissions + + + Sum + StnryAsstCrbnFprint$TotalScope2MarketBasedEmissions + + + Sum + StnryAsstCrbnFprint$TotalCarbonFootprint + + Stationary asset carbon footprints grouped by reporting year, with summed Scope 1, Scope 2 (location- and market-based), and total emissions. Year-over-year emissions trend for the stationary asset inventory. + Summary + + Day + StnryAsstCrbnFprint$ReportingYear + Asc + + Emissions by Reporting Year + Standalone_Carbon_Footprints + organization + true + + StnryAsstCrbnFprint$CreatedDate + INTERVAL_CUSTOM + + diff --git a/force-app/main/default/reports/NZC_Reports/Fleet_by_Fuel_Type.report-meta.xml b/force-app/main/default/reports/NZC_Reports/Fleet_by_Fuel_Type.report-meta.xml new file mode 100644 index 0000000..294275a --- /dev/null +++ b/force-app/main/default/reports/NZC_Reports/Fleet_by_Fuel_Type.report-meta.xml @@ -0,0 +1,24 @@ + + + + VehicleAsset$Name + + + VehicleAsset$VehicleType + + Vehicle asset inventory grouped by fuel type. Baseline view of the fleet composition driving Scope 1 mobile combustion emissions. + Summary + + Day + VehicleAsset$FuelType + Asc + + Fleet by Fuel Type + Standalone_Vehicle_Assets + organization + true + + VehicleAsset$CreatedDate + INTERVAL_CUSTOM + + diff --git a/force-app/main/default/reports/NZC_Reports/Fuel_Consumption_by_Fuel_Type.report-meta.xml b/force-app/main/default/reports/NZC_Reports/Fuel_Consumption_by_Fuel_Type.report-meta.xml new file mode 100644 index 0000000..604423b --- /dev/null +++ b/force-app/main/default/reports/NZC_Reports/Fuel_Consumption_by_Fuel_Type.report-meta.xml @@ -0,0 +1,34 @@ + + + + StnryAsstCrbnFprint$Name + + + StnryAsstCrbnFprint$ReportingYear + + + StnryAsstCrbnFprint.StnryAsstFossilFuelEnrgyUses$Name + + + Sum + StnryAsstCrbnFprint.StnryAsstFossilFuelEnrgyUses$FuelConsumption + + + StnryAsstCrbnFprint.StnryAsstFossilFuelEnrgyUses$FuelConsumptionUnit + + Fossil fuel energy use records behind stationary asset carbon footprints, grouped by fuel type with total fuel consumption. Supports Scope 1 stationary combustion analysis. + Summary + + Day + StnryAsstCrbnFprint.StnryAsstFossilFuelEnrgyUses$FuelType + Asc + + Fuel Consumption by Fuel Type + Footprints_with_Energy_Uses + organization + true + + StnryAsstCrbnFprint$CreatedDate + INTERVAL_CUSTOM + + diff --git a/force-app/main/default/reports/NZC_Reports/Suppliers_Missing_Metrics.report-meta.xml b/force-app/main/default/reports/NZC_Reports/Suppliers_Missing_Metrics.report-meta.xml new file mode 100644 index 0000000..dc70daa --- /dev/null +++ b/force-app/main/default/reports/NZC_Reports/Suppliers_Missing_Metrics.report-meta.xml @@ -0,0 +1,32 @@ + + + + Account$Name + + + Account$BillingCountry + + Accounts that have no related Supplier Metric record, grouped by industry. Use this to target suppliers for Scope 3 emissions data collection. + + + Account.SpplrMtrcs$Id + true + equals + + + + Summary + + Day + Account$Industry + Asc + + Suppliers Missing Metrics + Accounts_with_or_without_Supplier_Metrics + organization + true + + Account$CreatedDate + INTERVAL_CUSTOM + + diff --git a/manifest/package.xml b/manifest/package.xml index 988498d..3be6a5e 100644 --- a/manifest/package.xml +++ b/manifest/package.xml @@ -11,6 +11,10 @@ NZC_Reports NZC_Reports/Stationary_Assets_Missing_Footprints + NZC_Reports/Fuel_Consumption_by_Fuel_Type + NZC_Reports/Suppliers_Missing_Metrics + NZC_Reports/Emissions_by_Reporting_Year + NZC_Reports/Fleet_by_Fuel_Type Report From fbdb88f337ce236c6f67c7abb4ded8a030cd01ae Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 10 Jul 2026 18:42:03 +0000 Subject: [PATCH 3/3] Bump CI Node version to 22 for Salesforce CLI compatibility The sf CLI's bundled undici requires a newer Node runtime than 20.20.2 (webidl.util.markAsUncloneable), crashing on startup. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01XsipTUqX7dcQDkvUkaFCuC --- .github/workflows/validate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index cdbd54a..6ea2a95 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -29,7 +29,7 @@ jobs: - uses: actions/setup-node@v4 with: - node-version: 20 + node-version: 22 - name: Install Salesforce CLI run: npm install --global @salesforce/cli