personally dataport

eli.vidaleli.vidal Member Posts: 35
sorry, but my english is not good
i want to personally a dataport to import customers of a .txt

In the .txt I have this format:
"Steve, ...
Jan, ...
Mary, ...
..."


I want to import data like: "CL
"CL1Steve, ...
CL2Jan, ...
CL3Mary, ...
..."

if this question is too simple, sorry... but I'm a beginer...

thanks
eli

Comments

  • krikikriki Member, Moderator Posts: 9,118
    We're here to help beginners (and sometimes also experts).

    You have to create a few globals :
    -intEntryNo of type integer
    -txtHelp of type text100;

    In the "OnPreDataItem()"-trigger of the dataitem, you must put
    intEntryNo = 0;
    

    In the "OnAfterImportRecord()"-trigger of the dataitem, you must put
    intEntryNo += 1;
    txtHelp := 'CL' + FORMAT(intEntryNo) + Name); // I supposed that you read the name into the "Name"-field of the customer
    Name := COPYSTR(txtHelp,1,MAXSTRLEN(Name)); // this in case the string becomes longer than the maximum string you can put in "Name". This code avoids a run-time error.
    

    I hope I understood what you wanted.

    PS : in the beginning, also the specialists were beginners 8)
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • kinekine Member Posts: 12,562
    Of course, there are other ways, but I think that the kriki's way is the simplest one. If you want to know other ways, ask for more... :-)

    And as Kriki wrote: I was begginer too (and still I am sometime ;-))... may be that in some time you will answer the questions there...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • eli.vidaleli.vidal Member Posts: 35
    that's great!!!

    I really happy because it's a very good reply...

    thanks
    eli :D
Sign In or Register to comment.