Suppress New Line in MESSAGE and ERROR

gerdhuebnergerdhuebner Member Posts: 155
edited 2014-07-24 in NAV Three Tier
In NAV 2013 R2, the USERID for a Windowslogin normally contains a Backslash ('Domain\User', e. g.). But if the USERID function is used in an ERROR or MESSAGE, this backslash results in a new line, which is very annoying.
Unfortunately there seems to be no workaround for this. Even a text like 'domain\\user' results in two automatic line breaks. ](*,)
(tested with NAV 2013 R2, Build 36897)

Suggestion: Only the first parameter of the MESSAGE/ERROR function should be scanned for single (not doubled!) backslashes and only these should be converted into line breaks. Two consecutive backslashes should be printed as one "real" backslash.
Thus an ERROR('Wrong User ID %1.',USERID), e. g., would give the expected output result.

Comments

  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    I don't think the NAV DEV-team is reading this forum to pick up product suggestions (although I hope they do). In the meantime, you should use MS Connect for these suggestions, where people can vote on them: https://connect.microsoft.com/

    As a workaround you can replace the '\' in '/', which is not that much different to a user:
    MESSAGE(CONVERTSTR(USERID,'\','/'));
    
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • gerdhuebnergerdhuebner Member Posts: 155
    I don't think the NAV DEV-team is reading this forum to pick up product suggestions...
    I think so, too. But if another developer occurs the same problem and tries to find a workaround, he/she may save time in reading this here and realize quickly, that there is no clean workaround at the moment...
Sign In or Register to comment.