Discussions
How to use a Credential field in post headers
I'm struggling to understand how to use a credential field in a suitelet. The help documentation in NetSuite seems very poor / incomplete in this area. I've successfully used form.addCredentialField before in conjunction with the SFTP module, so I do have some experience with this.
But now, I'm trying to use a credential field to store an authorization token for a service I'm trying to connect to. It uses basic authentication. If I simply copy/past the auth token directly in the script, it works fine:
...
var actualToken = "abc123";
var authorization = encode.convert({ string: accountSID + ':' + actualToken, outputEncoding: encode.Encoding.BASE_64 });