I am using strong soap in Node to connect to Netsuite. I have managed to successfully extract the currency data out of Netsuite so I know i have set all the token based authentication up properly and can see it all working in the logs.
I am now branching out trying other soap queries.
I am trying the getDataCenterUrls request. However in the console I am just getting an 'undefined' error.
And when I check the logs on Netsuite I can see there is no attempt at a connection.
Code below. any help on what is missing?
UPDATE - Am now getting error 'DATA_REQD' 'You need to provide a proper value for the required field: account'. So must be an issue with how I am passing the account number.
client.getDataCenterUrls(
{
$attributes:{
account: 'XXXXXXXX',
},
},
(err, result) => {
if (result) {
let responseObject = result.getDataCenterUrlsResult;
console.log(responseObject);
} else {
console.log(err);
}
}
);
Okay. I have the answer. You use attributes to assign values based on parent/child hierarchies.
In this instance I was trying to assign the account number as an attribute of the the child data point 'account'.
But for this particular soap request account is the parent and only entry point.
So the code should be like this at the top: