importing from csv

Environment: Nav 3.60 running on WinXP, Database: MS SQL. Problem: Item Unit of Measure is missing. Description: Here it is - i try to import items and Item Unit of Measures. To simplify i made just 3 fields in the import file (Item No., Base Unit of Measure and Item Unit of Measure). The settings should be correct, because the import occurs, the problem is that Item Unit of Measures do not appear even tho the child table key (in DataItemTableView), DataItemLinkReference (Item) and DataItemLink (ItemNo. and No.) are set. Question: What is it i’m missing? I’ve read the manual about dataports in Navision Data Objects.pdf but did not find any clues in there. Is there any other manual/source of information i should read? Currently the only idea i have left is to beat drum and dance around the server, maybe it starts to work on its own [:p]. Annar

There are just so many things that could cause this, that it is hard to even start. Since this is a blindingly simple dataport, the solution will be also. Try checking 1/ Do you allready have records in the database that need updating (The update option in Dataports has no real relation to what it says in the online help). 2/ Do you actually have correct data in you CSV file. 3/ How are you chekcing if the data is there? (Are you looking at the correct table?) More info required. PS the field names you mention do not seem to connect to reality, you need to make it clear which table you are importing to, and which fields you are looking at.

The “Item Unit of Measure” is a separate table (not a field in the table Item). The fields “Base Unit of Measure”, “Sales Unit of Measure” and “Purch. Unit of Measure” in table Item all relate to this table (“Item No.”, Code). My guess (and I may be way off) is that your dataport needs 2 separate (no linking) dataitems: “Item Unit of Measure” and Item. But then again, I’m not quite sure what is is you’re trying to achieve [?]

Hello, If you are trying to import all these field in Item table ,then in OnafterimportRecord trigger first check whether unit of measure present in “Unit of Measure” table, if not insert it first there then , Insert item no and UOM combination in Item UOM table. This might solve your problem. Regards,

I cant seem to import two tables related to each other in one import. Other example is to import Items and have costing method set to FIFO at the same time (inside same import), how to do that?

Annar, you can import almost whatever you want… it’s just how you do it :slight_smile: Ok, when importing the items the easier way to to it is set autosave to false. Then, use the onAfterImportRecord trigger to make the program do whatever you need it to do: If you’re wanting to set several fields to fixed values (let’s say import all items with costing method set to FIFO), you are able of doing such modifications on that trigger, also if you’re needing to add more fields on different tables and all else you need to do. That also allows you choosing if you’re wanting to modify or not existing items. An example if your dataport is just reading “no.” and “Base Unit of measure” is as follows: onAfterGetRecord var itemUOM : record “Item unit of measure”; StdUOM : record “Unit of measure”; BEGIN Item.VALIDATE(“Costing method”,item.“Costing method”::FIFO); CLEAR (StdUOM); StdUOM.RESET; StdUOM.INIT; StdUOM.“Code” := item.“base unit of measure”; IF (StdUOM.INSERT(TRUE)) THEN ; CLEAR (ItemUOM); ItemUOM.RESET; ItemUOM.INIT; ItemUOM.“Item No.” := item.“No.”; ItemUOM.“Unit of measure” := item.“Base unit of measure”; IF (ItemUOM.INSERT(TRUE)) THEN ; IF (NOT Item.INSERT(TRUE)) THEN // if you are wanting to modify then use the following line: // IF (Item.MODIFY(TRUE)) THEN ; ; END; BTW… Answer number 666… take care…