---
id: object/codeunit/6299
type: object
title: Codeunit 6299 "Sustainability AI"
summary: Codeunit 6299 "Sustainability AI" in SustainabilityCopilotSuggestion (Microsoft.Sustainability.Copilot). 4 public procedures. Present since at least BC23, still in BC30, changed in BC25, BC29.
tier: official
language: en
tags:
  - codeunit
  - sustainabilitycopilotsuggestion
versions:
  introduced: null
  last_changed: "29"
  deprecated: null
review:
  state: derived
  by: null
  at: null
  flags: []
generated:
  at: "2026-10-11T00:31:51.816Z"
  pipeline: 0.2.0
  prompts: {}
  input_hash: f69b72e575c23fb8f2e55a97ec43dd62d0722daa2a907e4ffb2e99ee9256dbf1
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/W1/SustainabilityCopilotSuggestion/app/src/AI/SustainabilityAI.Codeunit.al
    title: src/Apps/W1/SustainabilityCopilotSuggestion/app/src/AI/SustainabilityAI.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
object_type: codeunit
object_id: 6299
name: Sustainability AI
namespace: Microsoft.Sustainability.Copilot
app: SustainabilityCopilotSuggestion
extends: null
first_version: "23"
last_version: "30"
present_in:
  - "23"
  - "24"
  - "25"
  - "29"
  - "30"
changed_in:
  - "25"
  - "29"
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 10
  events: 0
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 7
  called_by: 1
  implements: 0
---

# Codeunit 6299 "Sustainability AI"

> Codeunit 6299 "Sustainability AI" in SustainabilityCopilotSuggestion (Microsoft.Sustainability.Copilot). 4 public procedures. Present since at least BC23, still in BC30, changed in BC25, BC29.

SustainabilityCopilotSuggestion · Microsoft.Sustainability.Copilot · BC23-25, BC29-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/W1/SustainabilityCopilotSuggestion/app/src/AI/SustainabilityAI.Codeunit.al) · facts from BC29

## Properties

| Property | Value |
|---|---|
| Access | Internal |

## Procedures

- `AICall(var SustainEmissionSuggestion: Record "Sustain. Emission Suggestion"; var SourceCO2EmissionBuffer: Record "Source CO2 Emission Buffer"): Text` (internal)
- `AICall(var SustainEmissionSuggestion: Record "Sustain. Emission Suggestion"; var SourceCO2EmissionBuffer: Record "Source CO2 Emission Buffer"; UserMessage: Text): Text` (internal)
- `AICallForFilteredLines(var SustainEmissionSuggestion: Record "Sustain. Emission Suggestion"; var SourceCO2EmissionBuffer: Record "Source CO2 Emission Buffer"; var LastHandledLineNo: Integer; UserMessage: Text)` (internal)
- `MatchCategoryToInput(var SustainEmissionSuggestion: Record "Sustain. Emission Suggestion"; var SourceCO2EmissionBuffer: Record "Source CO2 Emission Buffer")` (internal)

Plus 6 local procedures.

## Calls

From the extracted call graph of BC29 (graphify-al on the snapshot checkout): calls whose target is known from a declared type or an `Object::"Name"` argument. Interface dispatch and calls through events are not counted, so the list is not complete.

- [Codeunit 8711 "Telemetry"](../codeunit/8711.md) (6 calls: `AddSourceCO2EmissionToUserMessage → LogMessage`, `AICall → LogMessage`, `AICallForFilteredLines → LogMessage`, …)
- [Codeunit 6331 "Sustainability Chat Completion"](../codeunit/6331.md) (2 calls: `AICallForFilteredLines → GenerateFormulaBreakdownChatCompletion`, `MatchCategoryToInput → GenerateMatchCategoryToInputChatCompletion`)
- [Codeunit 6290 "Sust. Emis. Suggestion Impl."](../codeunit/6290.md) (1 call: `AICall → GetFeatureName`)
- [Codeunit 6329 "Sustainability Formula"](../codeunit/6329.md) (1 call: `AICall → ApplyFormula`)
- [Codeunit 6333 "Sust. Emiss.Suggestion Warning"](../codeunit/6333.md) (1 call: `GenerateUserMessage → InsertWarnings`)
- [Codeunit 7771 "Azure OpenAI"](../codeunit/7771.md) (1 call: `AICall → IsEnabled`)
- [Codeunit 8703 "Feature Telemetry"](../codeunit/8703.md) (1 call: `AICall → LogUptake`)

## Called by

- [Page 6329 "Sustain. Emission Suggestion"](../page/6329.md) (1 call: `GenerateCopilotSuggestion → AICall`)

## Across versions

- Present in: BC23-25, BC29-30
- Changed (declaration) in: BC25, BC29

Source: AL metadata extracted from the code (names, ids, signatures, properties); no code bodies (D10).

## Ask your agent

Procedure bodies are not stored here (D10). The call sections above are our own, per object, from the BC29 call graph. For a procedure body or the calls of one procedure, ask bc-code-atlas (external, by Stefan Maron, MIT; default corpus w1-28), which the bc-observatory plugin connects: `bcatlas_resolve_node(object_type: "codeunit", object_name: "Sustainability AI")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
