Text field error on Import Dataport (end-of-string char.?)

mart1n0mart1n0 Member Posts: 123
I wrote a Dataport to import items. everything works perfect except for the following:

The description has a maximum length of 50, this field imports fine with a length up to 49, when the length is 50 it gives me an error that the field cannot be more than 50 characters. I guess this is because of the end-of-string character.

But if I enter a description manually I can add descriptions up to 50. Is there a way to import descriptions up to 50 characters without creating global variables and copy strings and such?

Comments

  • diptish.naskardiptish.naskar Member Posts: 360
    Check the string lenght of the description that you are trying to upload
    Diptish Naskar
    For any queries you can also visit my blog site: http://msnavarena.blogspot.com/
  • mart1n0mart1n0 Member Posts: 123
    Well diptish.naskar that is exactly the problem the strings in the import file ARE all smaller than 50 characters and if I input them trough the forms I CAN enter descriptions of 50 characters but the import only lets me import up to 49 characters. If I try to import something that is 50 it gives me the error that the field cannot be bigger than 50.

    So my guess is that it pastes an end-of-string character at the end making the field 51 and then gives an error.

    What I wanted to know is if there is a work around without writing code for this.
  • AlbertvhAlbertvh Member Posts: 516
    Hi

    in the Description - OnBeforeEvaluateField(VAR Text : Text[1024]) section you could do this

    IF STRLEN(Text ) > 50 THEN
    Text := COPYSTR(Text,1,50);


    Hope this helps

    Albert

    Edit. Sorry didn't read that you did not want to do it with code.
Sign In or Register to comment.