Skip to content

Instantly share code, notes, and snippets.

View benjsicam's full-sized avatar
:octocat:
Kaizen

Benj Sicam benjsicam

:octocat:
Kaizen
View GitHub Profile
@benjsicam
benjsicam / netsuite_date_time_zone_util.js
Last active June 21, 2016 11:54
A JavaScript utility for converting date/time zone objects in NetSuite to different time zones.
DateTimeZoneUtils = {
/**
* This is a method to get the current Date/Time
* based on the time zone offset specified.
*
* @param timeZoneOffSet {Number} - The time zone offset.
*
* @returns {Date} date - The Date/Time Object based on the time zone offset specified.
*/
getCurrentDateTime: function (timeZoneOffSet) {
@benjsicam
benjsicam / netsuite_recaptcha_css.js
Last active March 3, 2022 00:34
A client side script which executes on submit of an Online Lead Form and sends a POST request to a back-end suitelet which does the reCaptcha verification.
/*
* This is the external URL of the Suitelet we've created on Part 3 of this tutorial.
*/
var CAPTCHA_VERIFICATION_SUITELET_URL = 'https://forms.na1.netsuite.com/app/site/hosting/scriptlet.nl?script=89&deploy=1&compid=TSTDRV262509&h=cd6d5783f52fba53b0f3';
/**
* Executes when the user clicks the Submit button.
* @returns {Boolean} True to continue save, false to abort save
*/
@benjsicam
benjsicam / netsuite_recaptcha_suitelet.js
Last active August 16, 2018 02:30
A suitelet that acts as a proxy for reCaptcha verification.
var CAPTCHA_VERIFICATION_URL = 'https://www.google.com/recaptcha/api/verify'; //This is the verification URL
var CAPTCHA_PRIVATE_KEY = '6Lf1-OASAAAAAFkwdm0fLSAPErgLRw54VzF4aPrO'; //This is the private key we've obtained from Part 1 of this tutorial
/**
*
* @param {nlobjRequest} request Request object
* @param {nlobjResponse} response Response object
* @returns {Void} Any output is written via response object
*/