How to get Item No. with Dataport

ebermejoebermejo Member Posts: 6
Hello,
I need to import some item data with a Dataport but my file only contains the item "Description". How can I get the "No." of the "Description" from Item table using a Dataport?
Please help! [-o<

-e

Comments

  • SavatageSavatage Member Posts: 7,142
    are any of the descriptions the same?

    do the descriptions from your import file match exactly what you have in the system?
  • ebermejoebermejo Member Posts: 6
    The descriptions are unique but there will be possibility that they will not exactly match with the descriptions in our system. Some of our descriptions have comma (,) or dash (-) or letter "V" at end and they removed those in the file some times.
  • SavatageSavatage Member Posts: 7,142
    When the data might be an issue, I tend to import the data into a new table which I create.
    Creating fields that match the data i'm importing. Also keeping in mind, matching the type and size that is used in the item table. Then once you have this info in a new table you can add another field called NO_LOOKUP or something which is a flowfield. With calc formula like:
    Lookup(Item.No. WHERE (Description=FIELD(Impdescription)))

    where ImpDescription (imported description) is the name of your field in your new table holding the data.
    Now when you go look at the new table, if the descriptions match, the NO_LOOKUP should show a value. The one's that don't have a value you know you have a description mismatch. and you can focus fixing those descriptions.

    Once you have every line showing a value you can do many things to transfer the data to update the item table. ei/process report.

    Of you can even copy your whole table into excel and create a new file to be imported that now has an item no.

    another way would be import your file data into variables in the dataport. Using FIND to get a match.

    item.setrange(description, ImpDescription);
    if item.find('=') then begin
    map field
    map field
    end else begin
    currdataport.skip;
    end;

    but since you don't know which ones will match or not I would use the 2nd table and lookup.
    That way I can see what's correct and what's not and review all these items FIRST before I start making changes to my current data.
    You have to decide what's best for you.
  • ebermejoebermejo Member Posts: 6
    Let me try which way will work for us.
    Thanks Harry for your help. :thumbsup: :thumbsup: :thumbsup:
  • David_SingletonDavid_Singleton Member Posts: 5,479
    Savatage wrote:
    Of you can even copy your whole table into excel and create a new file to be imported that now has an item no.

    :thumbsup:

    In cases like this I always recommend doing it out side of Navision. Put the data in Excel and do it there.
    David Singleton
  • ChinmoyChinmoy Member Posts: 359
    Hi David,

    Is there any particular reason why you would prefer this to be done outside Navision? Except the fact that the Navision database would remain un-affected and clean. However, if it is a development database, how does that matter? Also, a lot of Navision developers feel comfortable in working with Navision objects, rather than working outside.

    Just a curiosity, to know what is/are the main reason(s) you would recommend such an activity.

    Kind regards,

    Chn
  • David_SingletonDavid_Singleton Member Posts: 5,479
    You have many more tools in Excel. Most importantly this is NOT A DEVELOPER project, developers should not be involved. This is a user project and users know Excel.
    David Singleton
Sign In or Register to comment.