Wednesday, March 16, 2022

D365 - removing new line character from string (note/memo/text) fields

I wrote a post about how to do this in AX 2009, but D365 has made it much easier with the global method strReplace().

It accepts a string, fromStr, toStr and returns the changed string.

So to clear out new line characters:

string StringwithNewline;

stringwithnewline = strReplace(stringwithNewLine,'\n',' ');

This will replace new line characters with a space.