Working on building with the SSP API's for our eCommerce site and am running into a few issues and errors. I was hoping someone could recommend some things.
I've created an SSP Application, and all appears to be configured correctly with the application.
I've created a file in my SSP Application called "ApiTest.ss". The contents of the file are:
function service(request, response) { response.setContentType("PLAINTEXT"); //// OUTPUT A MESSAGE INDICATING IF WE'RE CURRENTLY LOGGED IN try { response.write("nnIs Logged In: "+nlapiGetWebContainer().getShoppingSession().isLoggedIn()); } catch (ex) { response.write("nnIs Logged In: ERROR: "+ex+"nn"); } //// OUTPUT CURRENT CUSTOMER'S FIELD VALUES try { var customerInfo = nlapiGetWebContainer().getShoppingSession().getCustomer().getFieldValues(); response.write("nnCustomer Info: n"+JSON.stringify(customerInfo, null, 2)+"nn"); } catch(ex) { response.write("nnCustomer Info: ERROR: n"+ex+"nn"); } /// ATTEMPT A LOGIN OPERATION AND OUTPUT THE RESULTS OF THE OPERATION try { var loginInfo = nlapiGetWebContainer().getShoppingSession().login({email: "my.valid@email.address.com", password: "mypassword"}); response.write("nnLogin Operation: "+JSON.stringify(loginInfo, null, 2)); } catch (ex) { response.write("nnLogin Operation: ERROR: "+ex); } }Assume that I've been logged in correctly by logging in through NetSuite's default login page. If I run this file by opening the URL with a web browser (e.g. http://www.mydomain.com/COMPANY/APPName/ApiTest.ss) I get the following response.Is Logged In: false Customer Info: { "creditcards": null, "email": "my.valid@email.address.com", "name": "C35004 TEST CUSTOMER", "addressbook": null, "internalid": null, "emailsubscribe": "T" } Login Operation: ERROR: TypeError: Cannot find function login in object nlobjShoppingSessionDelegate.My questions are: 1) Why would "Is Logged In" be "false" if I am truly logged in (via regular login page on site)?2) Why would the call to "...getCustomer().getFieldValues()" return valid information if I wasn't really logged in?3) Why do I get a "function does not exist" error during the call to "...getShoppingSession().login()"?I would appreciate any recommendations anyone has.