Max length before validate

xavigepexavigepe Member Posts: 185
edited 2014-01-03 in NAV Three Tier
Hi. In comment sheet page, comments have a maximum length of 80 charcaters but in RTC when user writes on it he could write more than 80 characters and he just gets the error when validation takes part. This could be a bit annoying. Does anyone know any trick to avoid the user entering more than 80 characters just in the moment he is writing (and it works in classic clients)?

Thanks and happy new year.

Comments

  • whitaker_timwhitaker_tim Member Posts: 23
    I just ran a quick test in a base NAV 2013 database using the RTC comments page from the sales orders. The system stops me when I try to type more than 80 characters so I am not sure how your user is able to type more. What version of NAV and what functional area is the user in when entering comments?
    Tim Whitaker | Senior NAV Consultant/Developer | The Software Workshop Ltd. | http://www.thesoftwareworkshop.com
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    This behaviour is changed in NAV2013R2 I guess..
    We can enter more characters than the length and it shows error after validation.
  • tinoruijstinoruijs Member Posts: 1,226
    There is a difference in behaviour between the Description on the Comment Line and for example the Description on the Purchase Line..
    On the Purchase Line you cannot enter more than the maximum number of characters.
    Don't see the difference yet. Global Text does not have to have a length now. Maybe a global is used somewhere. :-k

    Tino Ruijs
    Microsoft Dynamics NAV specialist
  • matteo_montanarimatteo_montanari Member Posts: 189
    xavigepe wrote:
    Hi. In comment sheet page, comments have a maximum length of 80 charcaters but in RTC when user writes on it he could write more than 80 characters and he just gets the error when validation takes part. This could be a bit annoying. Does anyone know any trick to avoid the user entering more than 80 characters just in the moment he is writing (and it works in classic clients)?

    Thanks and happy new year.

    Hi

    I found Build 7.0.35282:
    "You can enter more characters in a field that has a variable as source expression than the length that is set for the variable"

    It can help you?

    bye

    Matteo
    Reno Sistemi Navision Developer
  • Big_DBig_D Member Posts: 207
    Hi xavigepe

    You could use a Variable called InputStr instead of writing to Comment Line Comment direct and have code similar to the following in the Comment Validate trigger...

    InputStr := '012345678901234567890123456789012345678901234567890123456789012345678901234567890123456780';
    StrLength := STRLEN (InputStr);
    IF StrLength > MAXSTRLEN (CommentLine.Comment) THEN
    CommentLine.Comment := COPYSTR (InputStr,1, MAXSTRLEN (CommentLine.Comment))
    ELSE
    CommentLine.Comment := InputStr;

    Good luck
    Big D signing off!
  • xavigepexavigepe Member Posts: 185
    Thanks all for your comments/solutions. I've found the difference between description in purchase lines and comments in purchase comments: If the page is of LIST type then control of the number of characters does not happen if it's of DOCUMENT type then control does happen.

    kind regards,
  • tinoruijstinoruijs Member Posts: 1,226
    xavigepe wrote:
    Thanks all for your comments/solutions. I've found the difference between description in purchase lines and comments in purchase comments: If the page is of LIST type then control of the number of characters does not happen if it's of DOCUMENT type then control does happen.

    Good to know. Thanks.

    Tino Ruijs
    Microsoft Dynamics NAV specialist
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    This behaviour is not existing in NAV2013 and previous versions.
    BTW: which version are you using?
Sign In or Register to comment.