From 295abd99ca746e5accf0bd4fe1234dcf33c60c84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Hartvig=20Gr=C3=B8nbech?= Date: Wed, 25 Feb 2026 14:39:50 +0100 Subject: [PATCH] E-Document Import - check length for GTIN (#6806) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### Summary This pr adds a check that ensures that an invalid gtin dont fail the setrange. #### Work Item(s) Fixes [AB#622663](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/622663) Co-authored-by: Magnus Hartvig Grønbech --- .../App/src/Helpers/EDocumentImportHelper.Codeunit.al | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Apps/W1/EDocument/App/src/Helpers/EDocumentImportHelper.Codeunit.al b/src/Apps/W1/EDocument/App/src/Helpers/EDocumentImportHelper.Codeunit.al index 8d72d2c034..bfe18bcc38 100644 --- a/src/Apps/W1/EDocument/App/src/Helpers/EDocumentImportHelper.Codeunit.al +++ b/src/Apps/W1/EDocument/App/src/Helpers/EDocumentImportHelper.Codeunit.al @@ -138,6 +138,9 @@ codeunit 6109 "E-Document Import Helper" if GTIN = '' then exit(false); + if StrLen(GTIN) > MaxStrLen(Item.GTIN) then + exit(false); + Item.SetRange(GTIN, GTIN); if not Item.FindFirst() then exit(false);