Discussions
Stay up-to-date with the latest news from NetSuite. You’ll be in the know about how to connect with peers and take your business to new heights at our virtual, in-person, on demand events, and much more.
Now is the time to ask your NetSuite-savvy friends and colleagues to join the NetSuite Support Community! Refer now! Click here to watch and learn more!
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 });
1