I’m adding a sublist of related communications to a custom record via UE Script. The related communications come from a combination of cases, transactions, and other related custom records. I’ve got my sublist all working well and retrieving the right messages and showing nicely in a sublist that I’m building using .addSublist(). The last thing I want to achieve is to show in a column a snippet of the body of the email, much like you’d see in the native Communications tab on records in NetSuite. I cannot figure out how to replicate what NetSuite does to strip out the HTML tags and truncate down to a reasonable length to get something like in this screenshot. If I create a saved search to test, I can see that the save search does the same stripping/truncating, but if I run that saved search in SuiteScript, the column is NOT stripped or truncated. Seems to only DISPLAY that way. Suggestions?
m
Marawan مَرَوَان
03/22/2026, 7:46 PM
So you are doing this with SuiteScript, right?
j
jen
03/23/2026, 3:36 PM
@Marawan مَرَوَان Correct
jen
03/23/2026, 3:37 PM
As I’m pulling in communications from a bunch of different records (cases, transactions, another type of custom record) and putting them into one combined list of communications, I cannot achieve this with just a Saved Search.
m
Marawan مَرَوَان
03/23/2026, 4:10 PM
If you just want to strip the html tags without using something complicated, you can use jQuery and use something like this
Or check the accepted answer here, if what you are using is a SuiteLet and you can use the
document.
API.
If I didn't understand you correctly, please post an example.
j
jen
03/23/2026, 4:12 PM
I’m not sure this will work as it’s server side. I need to prepare the stripped HTML in the UserEvent script.