Incorrect data after a dataport import

We are in an interim period in our Navision implementation, where we still use parts of our legacy system and parts of Navision. One implication is that new inventory items are first created in our legacy system, so we have set up a process to import new items into Navision via a dataport, in order to help reduce workloads on users who would otherwise have to create these manually. We use dataports also for our data conversion between the two systems and have been suspicious for a while about the accuracy of data after it has passed through the dataport. However, we now have good examples of a definite problem with the use of dataports and I am wondering if anyone else has experienced this problem. Sometimes a few, sometimes none, sometimes many new inventory items are being created via the dataport but show as blocked, even though the blocked field is not one of the fields in the dataport. There’s no coding in the dataport to set this field and we are at a loss to understand the cause. We overcome it by adding the blocked field to the dataport and setting the data with an “Unblocked” value, but really this should not be necessary. We run data into Navision via this dataport about once per week, and the number of items averages around 100-200 a time. Our NSC believes there’s a bug in the dataport. Any other views or experiences, please share them with me. If the problem was resticted to the item import dataport, I would not worry as much, except that we use dataports for the data conversion of hundreds of thousands of records and the implications of invalid data from this exercise is horrifying. Many thanks, Robert

Hi Robert, without publishing your dataport as code, nobody here can state that the dataport is correct. But if you published the datapart, please do also with a record to import.

Robert, could it be that the dataport calls VALIDATE on some (or all) fields and that the “blocked” field is set as a side effect in some table code, depending on the input data?

Guys . . thanks for your responses … I am happy to post our dataport here and an example data file, but really did not expect this level of help on this forum. I also can’t find a way to do this. How do I publish my dataport as code? I was looking for a way to attach a file to this posting but I could only find “Insert an Image” which didn’t seem to work. I’m sorry, but I also couldn’t find how to get online “Help” on this feature. Please briefly explain how to do as you suggest and I surely will. Thanks again, Robert

First of all you have to export your code to a *.TXT file. At the bottom is a link ‘Reply to Topic’ By clicking a little texteditor will open Here you can find a button ‘#’ that will set the frame for your code Then open TXT file and make it with copy and paste

Hans … thanks for your guidance … here’s the result of my export to text of the dataport we use to create new items. OBJECT Dataport 50018 itemijss { OBJECT-PROPERTIES { Date=14/05/02; Time=12:32:03; Modified=Yes; Version List=; } PROPERTIES { } DATAITEMS { { PROPERTIES { DataItemTable=Table27; } FIELDS { { ; ;"No." ;CallFieldValidate=No } { ; ;Description ;CallFieldValidate=No } { ; ;"Description 2" ;CallFieldValidate=No } { ; ;Class ;CallFieldValidate=No; OnBeforeEvaluateField=BEGIN IF Text<>'' THEN VALIDATE(Class,Text); END; } { ; ;"Base Unit of Measure"; CallFieldValidate=No } { ; ;"Inventory Posting Group"; CallFieldValidate=No } { ; ;"Costing Method" ;CallFieldValidate=No } { ; ;"Vendor No." ;CallFieldValidate=No } { ; ;"Vendor Item No." ;CallFieldValidate=No } { ; ;"Gram Weight (Final Item)"; CallFieldValidate=No } { ; ;"Gen. Prod. Posting Group"; CallFieldValidate=No; OnBeforeEvaluateField=BEGIN IF Text<>'' THEN END; } { ; ;"VAT Prod. Posting Group"; CallFieldValidate=No } { ; ;"Sales Unit of Measure"; CallFieldValidate=No } { ; ;"Purch. Unit of Measure"; CallFieldValidate=No } { ; ;"EDI Category" ;CallFieldValidate=No; OnBeforeEvaluateField=BEGIN IF Text<>'' THEN VALIDATE("EDI Category",Text); END; } { ; ;Cut ;CallFieldValidate=No; OnBeforeEvaluateField=BEGIN IF Text<>'' THEN VALIDATE(Cut,Text); END; } { ; ;Grade ;CallFieldValidate=No; OnBeforeEvaluateField=BEGIN IF Text<>'' THEN VALIDATE(Grade,Text); END; } { ; ;Size ;CallFieldValidate=No; OnBeforeEvaluateField=BEGIN IF Text<>'' THEN VALIDATE(Size,Text); END; } { ; ;Carat ;CallFieldValidate=No } { ; ;"Stone Type" ;CallFieldValidate=No; OnBeforeEvaluateField=BEGIN IF Text<>'' THEN VALIDATE("Stone Type",Text); END; } { ; ;"Stone Markup" ;CallFieldValidate=No; OnBeforeEvaluateField=BEGIN IF Text<>'' THEN END; } { ; ;"Product Type" ;CallFieldValidate=No; OnBeforeEvaluateField=BEGIN IF Text<>'' THEN VALIDATE("Product Type",Text); END; } { ; ;"Gross Weight" ;CallFieldValidate=No } { ; ;"Old Item No." ;CallFieldValidate=No } { ; ;"Casting Piece" ;CallFieldValidate=No } } } } REQUESTFORM { PROPERTIES { Width=9020; Height=3410; } CONTROLS { } } CODE { BEGIN END. } } Also, here’s a copy of some sample data we import via the above dataport … I’ll use the same Insert Code button for this … R23762-3YLB3,Ring LB ,,Y,PCS,FGR,Average,SIGM,23762LB,0,FGR,VAT-1,PCS,PCS,,,,,3,,0,R,3.201,TR10-23762-**1 R23762-9YLB3,Ring LB ,,Y,PCS,FGR,Average,SIGM,23762LB,0,FGR,VAT-1,PCS,PCS,,,,,9,,0,R,3.3,TR10-23762-**1 R23762-1YLB3,Ring LB ,,Y,PCS,FGR,Average,SIGM,23762LB,0,FGR,VAT-1,PCS,PCS,,,,,1,,0,R,3.366,TR10-23762-**1 R23762-4YLB3,Ring LB ,,Y,PCS,FGR,Average,SIGM,23762LB,0,FGR,VAT-1,PCS,PCS,,,,,4,,0,R,3.894,TR10-23762-**1 R23762-8YLB3,Ring LB ,,Y,PCS,FGR,Average,SIGM,23762LB,0,FGR,VAT-1,PCS,PCS,,,,,8,,0,R,4.554,TR10-23762-**1 The outcome of the import of this sample data is that the 5 items are marked as blocked on the Item Card … I also notice that the “Last Date Modified” field has a value, when normally it should be blank for newly created items. Anyway, Hans, I’ll say again that I am amazed that you are prepared to look at this for me, and that I am very grateful for your help. Regards, Robert

Robert, the dataport itself seems to be innocent - however, you should investigate what happens during the various calls to VALIDATE. For example, could it be that certain “Product Types” or “EDI Categories” are marked as “to be blocked”? You might also want to check the table’s OnModify trigger. The “Last Date Modified” is most likely to be set there, too. Did you try debugging the dataport to see what’s actually going on?

I think Heinz is right here Robert, you need to look into the code in table 27, the field “edi category” looks ominous, I am guessing you have a few mods in that system. Please run the import with the debugger, and see what happens.