Need help on design a data port in nav 2009 r2

Hello Friends,

I need help in designing Data port.

I have two tables 1. Item (Primary Key : “Item No.”)

  1. Barcodes (Primary Key : “Barcodes”)

Common Fields: “item No” , “Unit Price”.

Issue is i need update the unit price in both tables. And i have barcode wise unit price information. Following link we have in

Barcode table: Barcode → Item No → Unit Price.

Item Table: Item No.–> Unit Price.

Can any one please help me in coding part.




dataports are best used for importing/exporting data.

better use a processingonly report or a codeunit for that case.

i assume that you want to set the unit price from item to barcode.

try code:

// local variables
// Barcode | rec | Barcode
// item | rec | Item

if Barcode.findset(true,false) then
item.get(Barcode.“Item No.”);
Barcode.“Unit Price” := item.“Unit Price”;
Barcode.modify; = 0;


use a codeunit or a processingonly report instead of a dataport. a dataport is mainly used for import/export purposes.

do you set both field unit price values (barcode and item) with an external value or do you want to assign the item.“unit price” to the barcode.“unit price” value?

Hi Srinivas,

Is it safe to assume that you’re trying to import your updated price data from an external file? Or, are you updating price information from the keyboard? And, from what I infer from your description, may we conclude that your source price update data includes the barcode value and the price value, but not the ItemNo value?

On the relationship between the Barcode value and the ItemNo value in your Barcode table, in your application, would it ever be the case where a single Barcode value could be related to more than one ItemNo, or could one ItemNo have multiple Barcode values? The reason I ask is that, if you have a one-to-one relationship between Barcode and ItemNo, then you can easily use a barcode value to determine the related ItemNo value in the Barcode table, and from that, you have all you need to lookup the Item in the Item table. Another reason for asking is that, given that same one-to-one relationship between Barcode and ItemNo, I would wonder what purpose it serves to create a separate table for the barcode values. Having a second table like this suggests a many-to-one relationship between Barcode and ItemNo.

Having the answers to these questions would be very helpful in crafting the most appropriate answers to your questions.