Codeunit 6286 Sust. Resource Post Subscriber

Sustainability, Microsoft.Sustainability.Posting

Source AL, 55 lines

src/Apps/W1/Sustainability/app/src/Posting/SustResourcePostSubscriber.Codeunit.allines 12 to 27 of 55, Copyright (c) Microsoft Corporation. MIT

codeunit 6286 "Sust. Resource Post Subscriber"{    [EventSubscriber(ObjectType::Codeunit, Codeunit::"Res. Jnl.-Post Line", 'OnAfterResLedgEntryInsert', '', false, false)]    local procedure OnAfterResLedgEntryInsert(ResJournalLine: Record "Res. Journal Line"; var ResLedgerEntry: Record "Res. Ledger Entry")    begin        if CanCreateSustValueEntry(ResJournalLine) then            PostSustainabilityValueEntry(ResJournalLine, ResLedgerEntry);    end;    local procedure CanCreateSustValueEntry(ResJournalLine: Record "Res. Journal Line"): Boolean    begin        if not SustainabilitySetup.IsValueChainTrackingEnabled() then            exit(false);        exit(ResJournalLine."Sust. Account No." <> '');

All 55 lines