I am new with NS Suitelet scripting.
I have created an external and internal suitelet and deployed then both.
For external suitelet (loginform.js):
- I use https://rest.netsuite.com/rest/roles and pass in the username and password from the form.
- I get a response code 200 and NS returns the credential for the user.
- on the post I use
nlapiRequestURL(url)
whereurl
is the endpoint of the internal suitelet
For internal suitelet (verify.js)
- a simple function
{ var login = nlapiGetLogin(); }
- so if login is not null then user is logged in
So, if I log into Netsuite and execute the internal suitelet, I get valid login object.
But if the external suitelet calls the internal suitelet, it will throw an permission access error.
What am I missing here? I know that I probably do not have a "valid session".
I see this "valid session" mentioned a lot in the developer's guide but nowhere does it explain how to create or obtain this session.
Please help me create or obtain this valid NS session.