Codeunit 6250 Sust. Certificate Subscribers
Source AL, 75 lines
src/Apps/W1/Sustainability/app/src/Certificate/SustCertificateSubscribers.Codeunit.allines 6 to 21 of 75, Copyright (c) Microsoft Corporation. MIT
codeunit 6250 "Sust. Certificate Subscribers"{ var ConfirmationForClearEmissionInfoQst: Label 'Changing the Replenishment System to %1 will clear sustainability emission value. Do you want to continue?', Comment = '%1 = Replenishment System'; [EventSubscriber(ObjectType::Table, Database::Item, 'OnBeforeValidateEvent', 'Type', false, false)] local procedure OnAfterValidateItemTypeEvent(var Rec: Record Item; var xRec: Record Item) begin if (xRec.Type = xRec.Type::Inventory) and (Rec.Type <> Rec.Type::Inventory) then Rec.TestField("Sust. Cert. No.", ''); end; [EventSubscriber(ObjectType::Table, Database::Item, 'OnAfterValidateItemCategoryCode', '', false, false)] local procedure OnAfterValidateItemCategoryCode(var Item: Record Item; xItem: Record Item) begin if Item."Replenishment System" = Item."Replenishment System"::Purchase then