In a UE Script, I am trying to add a Custom Saved ...
# suitescript
j
In a UE Script, I am trying to add a Custom Saved Search of type Message (emails) to a Custom Record, using SuiteScript 2.1 and
form.addSublist()
. In the native NetSuite Communications tab, you can show the Message as a column, and it shows a snippet of the body of the email, with formatting removed. How would I achieve the same using the
message
column returned by a Message Saved Search? The SS seems to return the HTML formatted text which is super long, and not trimmed.
Note that I need to generate the Saved Search on the fly in SuiteScript as it is returning results based on a list of message IDs from a variety of related records.
a
I know this sounds dumb, but have you tried just outputting what you have? if its HTML and its in the browser, the browser may just parse and display the HTML correctly
j
it’s too long
EXCEEDED_MAX_FIELD_LENGTH
the built in communications area (and saved searches of type message) seem to automatically create some sort of “snippet”
a
i got nothing, sorry @jen
e
Have you tried removing the html tags via
str.replace( /(<([^>]+)>)/ig, '');
j
that’s what I’m trying now, it’s …. not going great lol
but will let you know how I get on
thanks anyhow!