Dataport - Convert data on import

nav_studentnav_student Member Posts: 175
Hi guys,

i want to know how can i convert data when importing data from a TAB file?

Example
1 Board
2 Tyre
3 Lights
and i can import data directly into the Item table ( Fields No. and Description), but how can i can convert data when i´m importing?

I want to see an example (C/AL Code) to convert the Description. For example when Nav read the Tyre converts to Car, so i the information on the table stays like this


No.----Description
1 Board
2 Car
3 Lights

Can you help me?

Comments

  • David_SingletonDavid_Singleton Member Posts: 5,479
    What have you tried so far? What errors are you getting? Did you read the spec that was written by the consultant? have you discussed with the functional consultant what they actually want?
    David Singleton
  • idiotidiot Member Posts: 651
    ...

    Why do you want to program something complex can that be done in a few simple clicks?
    Open the file with some text editing software
    Ctrl + h
    Find Tyre
    Replace Car
    Click replace all
    NAV - Norton Anti Virus

    ERP Consultant (not just Navision) & Navision challenger
  • SavatageSavatage Member Posts: 7,142
    The name is nav_student perhaps he just want to learn. There's a whole chapter on dataports in the ADG which is downloadable too if you don't have the CD.

    2nd. to accomplish this task I would import that data into variables

    impCODE, impDESCRIPTION for example.
    These name you will put in the Sourceexp of the dataport fields instead of the item table fields directly.
    OnAfterImportRecord trigger you can map them back to the correct fields and give you the flexability of checking & changing the data if needed.
    Item.Validate("No.", impCODE);
    If impDESCRTIPION = 'TYRE'
      then Description := 'CAR'
      else Description := impDESCRIPTION;
    

    that's the basics, now read up.
    http://www.microsoft.com/downloads/deta ... laylang=en
  • nav_studentnav_student Member Posts: 175
    Thanks Savatage!

    I test it and it runs OK.

    =D>
Sign In or Register to comment.