Codeunit 6263 Sust. Job Post Subscriber

Sustainability, Microsoft.Sustainability.Posting

Source AL, 80 lines

src/Apps/W1/Sustainability/app/src/Posting/SustJobPostSubscriber.Codeunit.allines 14 to 29 of 80, Copyright (c) Microsoft Corporation. MIT

codeunit 6263 "Sust. Job Post Subscriber"{    [EventSubscriber(ObjectType::Codeunit, Codeunit::"Job Jnl.-Post Line", 'OnAfterJobLedgEntryInsert', '', false, false)]    local procedure OnAfterJobLedgEntryInsert(JobJournalLine: Record "Job Journal Line"; var JobLedgerEntry: Record "Job Ledger Entry")    begin        if CanCreateSustValueEntry(JobJournalLine, JobLedgerEntry) then            PostSustainabilityValueEntry(JobJournalLine, JobLedgerEntry);    end;    local procedure CanCreateSustValueEntry(JobJournalLine: Record "Job Journal Line"; var JobLedgerEntry: Record "Job Ledger Entry"): Boolean    begin        if not SustainabilitySetup.IsValueChainTrackingEnabled() then            exit(false);        exit((JobJournalLine."Sust. Account No." <> '') and (JobLedgerEntry.Type <> JobLedgerEntry.Type::Item));

All 80 lines