bcquality/microsoft/knowledge/scm/post-revaluation-through-the-item-journal-batch.bad.al
Jesper Schulz-Wedde 9ac62e3967 Add SCM functional knowledge domain
Introduce nine source-backed rules with original AL sample pairs, bounded SCM review routing, and complete positive/clean evaluation coverage.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-17 15:54:23 +02:00

22 lines
840 B
AL

namespace BCQuality.SCM.Samples;
using Microsoft.Inventory.Journal;
using Microsoft.Inventory.Posting;
codeunit 50102 "SCM Revaluation Batch Bad"
{
procedure PostCalculatedRevaluationBatch(TemplateName: Code[10]; BatchName: Code[10])
var
ItemJournalLine: Record "Item Journal Line";
ItemJnlPostLine: Codeunit "Item Jnl.-Post Line";
begin
ItemJournalLine.SetRange("Journal Template Name", TemplateName);
ItemJournalLine.SetRange("Journal Batch Name", BatchName);
ItemJournalLine.FindSet();
repeat
ItemJournalLine.TestField("Value Entry Type", ItemJournalLine."Value Entry Type"::Revaluation);
ItemJournalLine.TestField("Inventory Value Per");
ItemJnlPostLine.RunWithCheck(ItemJournalLine);
until ItemJournalLine.Next() = 0;
end;
}