Aly
04/07/2025, 10:06 AMCeligo AI
04/07/2025, 10:07 AMAI generated answer (using internal Slack threads):The issue with the code not creating line breaks in the dialog box is due to the fact that the
dialog.alert
function in SuiteScript does not interpret \n
as a newline character. Instead, it treats it as a regular string.
To achieve a double line break per error message, you can use HTML tags. The dialog.alert
function accepts valid HTML in its message parameter. Therefore, you can use the <br/>
tag to create line breaks.
Here is the modified code:
javascript
if (errors.length > 0) {
dialog.alert({
title: 'Validation Errors (' + errors.length + ')',
message: errors.join('<br/><br/>')
});
return false;
}
In this code, errors.join('<br/><br/>')
will join all the error messages with a double line break (<br/><br/>
) between each message.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
04/07/2025, 10:07 AMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.843812168
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.833261788
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.829066813
Celigo AI
04/07/2025, 10:07 AMCeligo AI
04/07/2025, 10:08 AMCeligo AI
04/07/2025, 10:08 AMCeligo AI
04/07/2025, 10:08 AM