Skip to content

Instantly share code, notes, and snippets.

Avatar
🤐
Burnt Out

Charles Bastian W3BGUY

🤐
Burnt Out
View GitHub Profile
@W3BGUY
W3BGUY / Jitterbit_SQLite_Update
Created Jan 12, 2021
Updates to improve SQLite performance.
View Jitterbit_SQLite_Update
[LogSync]
# Max number of records at once to sync - This is the initial batch size only! After retries it goes
#back to MinRecordsToSync!
MaxRecordsToSync=500
#Max sleep between retries
MaxRetryDelaySec=60
#It's actually the maximum after retries have kicked in!
MinRecordsToSync=500
In resources/jitterbit-agent-config.properties
@W3BGUY
W3BGUY / Jitterbit_PowerShell.ps
Created Nov 25, 2020
Call a Powershell command from within Jitterbit
View Jitterbit_PowerShell.ps
// Author - Danial Fields
$command = "cmd";
$arguments = '/c powershell -ExecutionPolicy ByPass -File "C:\\directory\\RunCommand Test.ps1" -p1 ' + $p1 + ' -p2 ' + $p2 + ' -p3 '+ $p3 + '"';
@W3BGUY
W3BGUY / REST_Query_File_Contents_by_InternalID.js
Created Nov 23, 2020
Return NetSuite file contents by NetSuite file internal ID.
View REST_Query_File_Contents_by_InternalID.js
/**
* @NApiVersion 2.0
* @NScriptType Restlet
* @NModuleScope SameAccount
* @Author Charles.Bastian
* @Created 2019-03-13
* @ScriptName REST_Query_File_Contents_by_InternalID
* @Filename REST_Query_File_Contents_by_InternalID.js
* @ScriptID customscript_rest_get_file_contents
* @Production
@W3BGUY
W3BGUY / Wifi Password List
Created Aug 16, 2020
List of random passwords that I've gathered
View Wifi Password List
Gloria's Cafe
- I Love Gloria's
- iloveglorias
Austin Oral (on 1)
- AOS-GUEST
- aos-guest
Dozen Street
- The Doz
@W3BGUY
W3BGUY / NetSuite_DueDateCalculation.js
Last active Aug 6, 2020
Simple function to calculate the due date based on an invoice date and terms ID.
View NetSuite_DueDateCalculation.js
function calculateDueDate(termID,invDate){
var dueDate=''
try{
var daysToAdd=search.lookupFields({type:'term',id:termID,columns:['daysuntilnetdue']}).daysuntilnetdue;
dueDate=new Date(format.parse({value:invDate,type:format.Type.DATE}));
dueDate.setDate(dueDate.getDate()+parseInt(daysToAdd));
}catch(err01){
log.error('calculateDueDate.err01',JSON.stringify(err01));
handleErrorAndSendNotification(err01,'calculateDueDate');
}finally{
@W3BGUY
W3BGUY / NetSuite Transaction Status Codes
Created Aug 4, 2020
List of NetSuite Transaction Status Names and Codes
View NetSuite Transaction Status Codes
Bill:Open <===> VendBill:A
Bill:Paid In Full <===> VendBill:B
Bill Payment:Voided <===> VendPymt:V
Bill Payment:Online Bill Pay Pending Accounting Approval <===> VendPymt:Z
Cash Sale:Unapproved Payment <===> CashSale:A
Cash Sale:Not Deposited <===> CashSale:B
Cash Sale:Deposited <===> CashSale:C
Check:Voided <===> Check:V
Check:Online Bill Pay Pending Accounting Approval <===> Check:Z
Commission:Pending Payment <===> Commissn:A
@W3BGUY
W3BGUY / CB_CM_CustomModule.js
Created Mar 12, 2020
NetSuite_SuiteScript_2.0_Custom_Module
View CB_CM_CustomModule.js
/**
* CB_CM_CustomModule.js
* @NApiVersion 2.x
* @NModuleScope SameAccount
*
* @Author: Charles.Bastian
* @Created: 2020-03-12
* @ScriptName: CB_CM_CustomModule
* @Filename: CB_CM_CustomModule.js
* @ScriptID:
@W3BGUY
W3BGUY / JavaScript - Remove Duplicates from Array
Created Sep 10, 2019
On liner that can be used to remove duplicates from an array. Great for use in NetSuite scripts.
View JavaScript - Remove Duplicates from Array
var newArray=oldArray.reduce(function(a,b){if(a.indexOf(b)<0)a.push(b);return a;},[]);
@W3BGUY
W3BGUY / REST_Query_File_Contents_by_InternalID.js
Created Mar 22, 2019
Simple NetSuite SuiteScript 2.0 RESTlet to gather file information, since the basic call does not return the file contents.
View REST_Query_File_Contents_by_InternalID.js
/**
* @NApiVersion 2.x
* @NScriptType Restlet
* @NModuleScope SameAccount
* @Author Charles.Bastian
* @Created 2019-03-13
* @ScriptName REST_Query_File_Contents_by_InternalID
* @Filename REST_Query_File_Contents_by_InternalID.js
* @ScriptID customscript_rest_get_file_contents
* @Production
@W3BGUY
W3BGUY / netsuiteCountryDict.txt
Last active Aug 8, 2019
Jitterbit - Country/Country Codes to NetSuite Country Format
View netsuiteCountryDict.txt
<trans>
/*
convert input country names/abbreviations to the NetSuite country code
*/
$netsuiteCountryDict = Dict();
$netsuiteCountryDict["Afghanistan"]="_afghanistan";
$netsuiteCountryDict["Albania"]="_albania";
$netsuiteCountryDict["Algeria"]="_algeria";
$netsuiteCountryDict["American Samoa"]="_americanSamoa";