i want to import a text file with comments to customers.
the textfile contains the customer no. and a comment field >150 characters.
how can i create multiple lines in den comments-table during the import ? ](*,)
Well, I had the same kind of problem recently with an access database. I had about 100 memo-fields to convert to multiple lines in Navision.
If you are familiar with VB.NET:
I took my WaldoNavPad, and I used the navpad-dll to write a seperate small program, which gave me a txt-file with the different lines. I just had to write the different SQL-statements, and the export/import only took a few hours.
If not familiar with VB.NET:
You can read it with a dataport into a 1024 variable, and write some code to divide it into seperate lines ... . Not sure this works, though...
I had the same Problem with much longer texts, but I used XMLport.
So there is the possibility to set the text to bigtext.
Then I created some code to divide into seperate lines with search for a space to cut the line not in a word.
in XMLPort this works perfectly.
regards,
Michael Schumacher
oh, what day is it? Backup day. OK, let's dump all data to /dev/nul ;-)
create global variable in the dataport. add the global variable to the dataport fieids. on after import trigger parse the global virable and insert into the customer comment.
Ahmed Rashed Amini
Independent Consultant/Developer
Note that when you cut-off at 100 characters, it may well be that you are going to cut off in the middle of a word. Using the dll, you can avoid this ... .
Comments
If you are familiar with VB.NET:
I took my WaldoNavPad, and I used the navpad-dll to write a seperate small program, which gave me a txt-file with the different lines. I just had to write the different SQL-statements, and the export/import only took a few hours.
If not familiar with VB.NET:
You can read it with a dataport into a 1024 variable, and write some code to divide it into seperate lines ... . Not sure this works, though...
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
I had the same Problem with much longer texts, but I used XMLport.
So there is the possibility to set the text to bigtext.
Then I created some code to divide into seperate lines with search for a space to cut the line not in a word.
in XMLPort this works perfectly.
Michael Schumacher
oh, what day is it? Backup day. OK, let's dump all data to /dev/nul ;-)
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
flFile.Open('Filename');
flFile.CreateInstream(isInstream);
While Not (isInstream.EOS()) do
Begin
intCount := isInstream.Readtext(strContainer, 100)
// Do something with strContainer
End;
flFile.Close();
Note that the value '100' denote the length of strContainer.
This basic routine makes it possible to do anything with any text regardless of length.
Note that when you cut-off at 100 characters, it may well be that you are going to cut off in the middle of a word. Using the dll, you can avoid this ... .
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog