How to avoid Special char in NAV?

chandrurecchandrurec Member Posts: 560
Hi all,

When I copy the values from excel to a text bos in NAV, the expty spaces is coming in the form of boxes, is there any property or coding to avoid this .

Thanks in advance.

Regards,
Chandru.

Comments

  • klavinklavin Member Posts: 117
    One way would be to strip out the Carriage Return and Line Feed (Char 10 and 13) from the text. Can be done globally for Text fields in the Application Management (CU1) MakeText function I would assume. Beware, this function is called whenever text is entered into a text field.

    This is where you get the standard functionality of using a ? to get the Standard Text pop-up.

    Otherwise, you would have to make your own function and call it onvalidate of fields, which would be a lot of repetitive code.
    -Lavin
    "Profanity is the one language all programmers know best."
  • rhpntrhpnt Member Posts: 688
    Are we talking copy/paste or import?
  • chandrurecchandrurec Member Posts: 560
    Hi,

    I am copying a cell from excel and pasting it in NAV Text field at that time I am getting 2 boxess getting appended to this string.

    Kindly tell me how to avoid this.

    Regards,
    Chandru.
  • rhpntrhpnt Member Posts: 688
    By copying only the text not the whole cell or by deleting them manually in NAV...
  • SavatageSavatage Member Posts: 7,142
    did you read the posts above?

    Several solutions posted here:
    viewtopic.php?f=23&t=32805
  • chandrurecchandrurec Member Posts: 560
    Hi Savatage,

    I have given the coding like this in the Posting No field On Validate trigger


    CHAR10 := 10;
    CHAR13 := 13;
    POS := STRPOS("Posting No.", FORMAT(CHAR10));
    IF POS <> 0 THEN ERROR('Pasting Canceled Carrage Return Exists');
    POS := STRPOS("Posting No.", FORMAT(CHAR13));
    IF POS <> 0 THEN ERROR('Pasting Canceled Line Feed Exists');

    is CHAR 10 and CHAR 13 are integer datatype ?

    but still when i copy the cell from excel to nav the boxes are getting appended to the string .

    Kindly give me a soluion to avoid this

    Thanks & Regards,
    Chandru
  • FDickschatFDickschat Member Posts: 380
    Yes, there is a solution. Use the Search, Luke!

    http://lmsmfy.com/?q=Carriage%20Return and read the forum entry "Hidden Characters (Carriage Return and Line Feed)"
    Frank Dickschat
    FD Consulting
  • SavatageSavatage Member Posts: 7,142
    Yes that code just tells you there are "special chars" and doesn't let you enter them.
    It's more of a notification to the user to go & edit the string by removing these chars before continuing.

    The post also has a solution you put in CU1.

    You can also try copying the value from the function bar Fx instead of the cell.
    Ps why would you be pasting into the "Posting No." field to begin with?
  • klavinklavin Member Posts: 117
    Savatage wrote:
    did you read the posts above?

    Several solutions posted here:
    viewtopic.php?f=23&t=32805

    Haha, sorry Harry, thought you were mentioning that it was a double post... I saw it was then came into this one and replied a suggestion lol.

    -Kevin
    -Lavin
    "Profanity is the one language all programmers know best."
  • SavatageSavatage Member Posts: 7,142
    No sorry needed , I was actually replying to the 5 or 6th post where it was asked again how to do it.
  • chandrurecchandrurec Member Posts: 560
    Hi Savatage,

    I got the output. Thank you so much.

    Regards,
    Chandru.
Sign In or Register to comment.