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.
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
Keep an eye out for upcoming NetSuite events, including meetups, workshops, and webinars. These sessions are a great way to connect with peers, learn from experts, and stay current on the latest NetSuite updates and best practices. Registration links are provided in each event.
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