Boban Dragojlovic
09/27/2024, 3:23 PMCeligo AI
09/27/2024, 3:23 PMAI generated answer (using internal Slack threads):When you call a Suitelet from a Client Script and the response includes HTML comments of server statistics, it's likely because NetSuite is interpreting your response as HTML. This usually happens when the response contains '<' or '>' characters. To avoid this, you need to specify the response type in your Suitelet by setting the 'Content-Type' header to 'application/json'. This tells NetSuite that the response is JSON data, not HTML, and it should prevent the addition of the server statistics comments. Here is a code sample on how to set the 'Content-Type' header in your Suitelet:
javascript
scriptContext.response.setHeader({
name: 'Content-Type',
value: 'application/json',
});
After setting the 'Content-Type' header, your response should no longer include the HTML comments of server statistics.
******
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
09/27/2024, 3:23 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.839911222
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.838630199
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.834008396
Celigo AI
09/27/2024, 3:23 PM