Hi everyone,Does anyone know how to handle CORS is...
# suitescript
m
Hi everyone,Does anyone know how to handle CORS issues in NetSuite (SL)? I'm building a front-end page with Vue and want to fetch data from a NetSuite script for testing, but I can't get around the cross-origin problem. I’ve tried using a proxy, but it didn’t work. I’m now looking for a way to solve the CORS issue on the server side. Any advice would be greatly appreciated!
c
This is a hard problem in NetSuite - I've played around with setting various headers and still struggled. What is your use case?
n
From your Vue client side, call the suitelet, and then that suitelet will call the other endpoint for you.
c
I was thinking the same with a restlet - understanding the use case would help.
m
We took a different approach — during local development, we disabled CORS in Chrome and directly called the Suitelet script’s API. Once the page development was complete and we deployed it to NetSuite, the cross-origin issue no longer existed.