Skip to content

Instantly share code, notes, and snippets.

View W3BGUY's full-sized avatar
🤐
Burnt Out

w3bguy W3BGUY

🤐
Burnt Out
View GitHub Profile
@W3BGUY
W3BGUY / NetSuite Transaction Status Codes
Created August 4, 2020 19:45
List of NetSuite Transaction Status Names and 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 / NetSuite_TBA_OAuth.php
Last active February 17, 2024 06:47
Basic PHP NetSuite OAuth1.0 (SHA256) authentication to call RESTlet script.
<?php
/**
* @Author w3bguy
* @Created 2021-09-08
*
* Description:
* Basic PHP NetSuite OAuth1.0 (SHA256) authentication to call RESTlet script.
*
* @modifications
* Date Author Version Remarks
@W3BGUY
W3BGUY / JavaScript - Remove Duplicates from Array
Created September 10, 2019 18:49
On liner that can be used to remove duplicates from an array. Great for use in NetSuite scripts.
var newArray=oldArray.reduce(function(a,b){if(a.indexOf(b)<0)a.push(b);return a;},[]);
@W3BGUY
W3BGUY / JitterBit-Validate_URL
Last active February 20, 2023 12:07
Validate a URL format using RegExMatch()
<trans>
url='www.test.net';
url='http://www.test.com lkjasdhfkhasdf';
if(Left(ToLower(url),4)!='http' && Left(ToLower(url),5)!='https',
url='https://'+url;
);
regTest='^((http|https):\/\/)?(www.)?(?!.*(http|https|www.))[a-zA-Z0-9_-]+(\.[a-zA-Z]+)+((\/)[\w#]+)*(\/\w+\?[a-zA-Z0-9_]+=\w+(&[a-zA-Z0-9_]+=\w+)*)?\/?$';
if(RegExMatch(url,regTest)!=-1,
url;,
@W3BGUY
W3BGUY / JitterBit-Validate_Email
Last active February 14, 2023 20:32
Validate email format using RegExMatch
<trans>
email='testemail@test.co';
regTest='([A-z0-9._%+-]+@[A-z0-9.-]+\\.[A-z]{2,4})';
if(RegExMatch(email,regTest)>0,
email;,
Unmap();
);
</trans>
@W3BGUY
W3BGUY / NetSuite_SOAP_Customer_Upsert-Postman.txt
Last active February 8, 2023 11:39
Postman setup for NetSuite SOAP customer upsert
Method: POST
URL: https://123456-sb1.suitetalk.api.netsuite.com/services/NetSuitePort_2022_2
Add headers:
Content-Type: text/xml
SOAPAction: upsert
@W3BGUY
W3BGUY / 00-Jitterbit_NetSuite_REST_API_DELETE
Last active January 25, 2023 16:26
Jitterbit Script to Call NetSuite REST API to Delete Records
01> Create transformation operation with script 01 as the first step.
02> Create script operation with step 02 as teh script (called by script 01 script).
03> Create JavaScript with contents from step 03 (called by Step 02 script).
@W3BGUY
W3BGUY / 00-Jitterbit_NetSuite_REST_API_PUT
Last active January 25, 2023 16:20
Jitterbit Script to Call NetSuite REST API to Upsert Records
01> Create transformation operation with script 01 as the first step.
02> Create script operation with step 02 as teh script (called by script 01 script).
03> Create JavaScript with contents from step 03 (called by Step 02 script).
@W3BGUY
W3BGUY / 00-Jitterbit_NetSuite_REST_API_PATCH
Last active January 25, 2023 16:09
Jitterbit Script to Call NetSuite REST API to Update Records
01> Create transformation operation with script 01 as the first step.
02> Create script operation with step 02 as teh script (called by script 01 script).
03> Create JavaScript with contents from step 03 (called by Step 02 script).
@W3BGUY
W3BGUY / 00-Jitterbit_NetSuite_REST_API_GET
Last active January 25, 2023 16:08
Jitterbit Script to Call the GET NetSuite REST API - use with (NS_Encode_oAuth_Params_and_Signature.js)
01> Create transformation operation with script 01 as the first step.
02> Create script operation with step 02 as teh script (called by script 01 script).
03> Create JavaScript with contents from step 03 (called by Step 02 script).