[Event Request] Codeunit 1607 - OnBeforeIsValidCheckDigit
New event for Codeunit 1607 GLN Calculator, at the beginning of the function IsValidCheckDigit:
local procedure IsValidCheckDigit(GLNValue: Code[20]; ExpectedSize: Integer): Boolean
var
IsHandled:Boolean; // New Variable
begin
// New Event
OnBeforeIsValidCheckDigit(GLNValue,ExpectedSize,Var IsValid:boolean, Var Ishandled: boolean);
if IsHandled then
exit(IsValid);
// New Event
if GLNValue = '' then
exit(false);
if StrLen(GLNValue) <> ExpectedSize then
Error(GLNLengthErr, ExpectedSize, StrLen(GLNValue));
exit(Format(StrCheckSum(CopyStr(GLNValue, 1, ExpectedSize - 1), '131313131313')) = Format(GLNValue[ExpectedSize]));
end;
Alternatively, expose this function and add a Checksum parameter, in case we need to call this with a different ExpectedSize or in case '131313131313' is not a suitable checksum value. Or add an "AssertValidCheckDigit" function that has these parameters.
Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. We will update this issue with information about availability. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.