So, trying to put the finishing touches on a dashboard and this is bugging me. I’m giving the user the ability to enter a comment into a TextArea, which is being saved to a ud column.
Initially looks good… saves.
If I then re-open that record… it comes back in looking like this:
Looking at the dataview, it is being saved as this:
So, it is taking my hitting the “enter” key when entering the text and injecting a “\n” (new line).
What I really need is a “\r\n” Carriage Return Line Feed.
… or even \r (Char13). I’ve proven this based on the Part Descriptions I imported via DMT where I included Char(13).
They appear like this:
and the dataview includes this:
I have been playing around with various expressions in my row-update to “replace” the \n with \r\n… but not finding the special sauce.
I’ve been playing around with things like:
#_'String original = '{TransView.AdjComments}'; original.replace("\n","\r\n")'_#
… but… I get an error:
function body 'String original = 'Line 1Line 2'; original.replace("\n","\r\n")' thrown exception SyntaxError: Unexpected identifier 'Line'
So, it appears, here, even though the dataview shows the \n (pictured above) the expression doesn’t see it, as it is just showing the original string as
Line 1Line2
Was hoping I could programmatically pull this off.
I’ve tried simplifying to just:
#_({TransView.AdjComments}.replace("\n","\r\n"))_#
But errors as:
function body Line 1Line 2; replace("","") thrown exception SyntaxError: Invalid or unexpected token
.replace may not be supported at all in this case.
Anybody have any thoughts? I’m just throwing things at the wall at this point hoping to get lucky. Not even sure if this is doable in a row-update expression.
… and I’ll apologize in advance as I type this up, its the end of my day so I have to run to pick up my kids. But, I’ll try any lobbed suggestions in the morning!
Thanks in advance.