This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Gloria's Cafe | |
- I Love Gloria's | |
- iloveglorias | |
Austin Oral (on 1) | |
- AOS-GUEST | |
- aos-guest | |
Dozen Street | |
- The Doz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Simple way to remove all non-numeric characters from a string, in JitterBit | |
$phone=RegExReplace($phone,"(\\D)",""); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Author - Danial Fields | |
$command = "cmd"; | |
$arguments = '/c powershell -ExecutionPolicy ByPass -File "C:\\directory\\RunCommand Test.ps1" -p1 ' + $p1 + ' -p2 ' + $p2 + ' -p3 '+ $p3 + '"'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Connect to PostgreSQL from Linux | |
/opt/jitterbit/pgsql/bin/psql -d postgres -U jitterbit -p 46914 | |
# List databases | |
\l | |
# list tables | |
\dt | |
# Connect to TranDb database |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// function to add leading zeros on date parts. | |
function zeroPad(num,len){ | |
var str=num.toString(); | |
while(str.length<len){str='0'+str;} | |
return str; | |
} | |
// function to format date object into NetSuite's mm/dd/yyyy format. | |
function formatNSDate(dateObj){ | |
if(dateObj){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getItemType(itemID){ | |
var itemData={}; | |
try{ | |
itemData=search.lookupFields({type:search.Type.ITEM,id:itemID,columns:['type','externalid','price','displayname']}); | |
log.debug('itemData',JSON.stringify(itemData)); | |
}catch(err01){ | |
log.error('getItemType('+itemID+').err01',JSON.stringify(err01)); | |
}finally{ | |
return itemData; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$countryCodeDict=Dict(); | |
AddToDict('countryCodeDict','AF','_afghanistan'); | |
AddToDict('countryCodeDict','AX','_alandIslands'); | |
AddToDict('countryCodeDict','AL','_albania'); | |
AddToDict('countryCodeDict','DZ','_algeria'); | |
AddToDict('countryCodeDict','AS','_americanSamoa'); | |
AddToDict('countryCodeDict','AD','_andorra'); | |
AddToDict('countryCodeDict','AO','_angola'); | |
AddToDict('countryCodeDict','AI','_anguilla'); | |
AddToDict('countryCodeDict','AQ','_antarctica'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add to Jitterbit.conf file | |
[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 |