mirror of
https://github.com/microsoft/BCQuality.git
synced 2026-10-05 14:46:55 +01:00
Contributed from Curabis's own BCQuality custom layer, rewritten to the community contribution contract (no fenced code in the .md, AL samples as sibling .good.al/.bad.al files, under 100 lines per article).
14 lines
510 B
AL
14 lines
510 B
AL
codeunit 50150 "Contoso Header Field Lookup"
|
|
{
|
|
procedure GetVatProdPostingGroup(DocumentNo: Code[20]): Code[20]
|
|
var
|
|
Header: Record "Contoso Document Header";
|
|
begin
|
|
// The same guarded shape used for a low-risk field is reused here
|
|
// without re-examining the consequence — a missing header now
|
|
// silently posts with a blank VAT posting group.
|
|
if Header.Get(DocumentNo) then
|
|
exit(Header."VAT Prod. Posting Group");
|
|
exit('');
|
|
end;
|
|
}
|