Options

Space at end of text field

jwilderjwilder Member Posts: 263
I have created a table that I use to run against the Ship-To Address field to see if there is a PO Box in the address. The table has one field which is Text50. The table has values in it such as P O, P.O., PO BOX etc...

I am shocked to see that I cannot enter a space at the end of the text. For example I want P O (with a space at the end). But NAV is removing the trailing space. I can have a space at the begging just not at the end. I would expect leading and trailing spaces to be removed for a Code field but not text. Anyone have a way around this?

I am using NAV 2009 R2 Classic.

Comments

  • Options
    Big_DBig_D Member Posts: 203
    Hi Jwilder

    How you reading the file?


    FileTest.OPEN ('c:\temp\PO.txt');
    // FileTest is File Type
    FileTest.CREATEINSTREAM (StreamInTest);
    //streamInTest is InStream Type
    WHILE StreamInTest.EOS () = FALSE DO
    BEGIN
    StreamInTest.READTEXT (Txt,100);
    MESSAGE ('(%1) strlen = %2', Txt, STRLEN (Txt));
    END;

    Result

    (P O ) strlen = 4

    Hope this helps!
    Big D signing off!
  • Options
    jwilderjwilder Member Posts: 263
    I am not reading a file. I am looping through this table and checking it against the "sales header"."ship-to address" field to see if it contains that value.

    My question was how to enter a text value in a table in NAV with a space at the end.

    I have found a work around for now. I added a button that takes the value through code and adds a space (like this: value := value + ' ';). It works but still don't understand why a user can't enter a space at the end.
  • Options
    sumitnandhasumitnandha Member Posts: 3
    HI,

    i have try With creating new field Text [30], its working fine for ur Query.

    Have you check after with creating new field for Test purpose.

    thank You
Sign In or Register to comment.