BankStatementParserOutput
Type |
Interface output object |
Description |
Output object for parseBankStatement. When NetSuite requests the bank statement content, this object parses and sends the translated transaction data to NetSuite. |
Methods |
|
Parent Object(s) |
N/A |
Child Object(s) |
createNewAccountStatement
Function Declaration |
|
Type |
Object method |
Description |
Create a new ParsedAccountStatement object to enable the Bank Statement Parser Plug-in to set property values. This method does not persist a new account statement in NetSuite. |
Returns |
|
Input Parameters |
None |
Parent object |
Example
var accountStatement = context.output.createNewAccountStatement();
accountStatement.accountMappingKey = defaultAccountMappingKey;
log.debug({
title: 'Adding a new account statement',
details: accountStatement
});
addAccountStatement
Function Declaration |
|
Type |
Object method |
Description |
The plug-in calls this method to persist an account statement record in NetSuite, which enables the plug-in to later associate transactions to the account. |
Returns |
int – the record ID of the account statement. |
Input Parameters |
ParsedAccountStatement – the object containing information to create the account statement record. |
Parent object |
Example
var accountStatementId = context.output.addAccountStatement({"parsedAccountStatement":accountStatement});
log.debug({
title: 'New account statement ID',
details: accountStatementId
});
createNewTransaction
Function Declaration |
|
Type |
Object method |
Description |
Create a new object handler to enable the Bank Statement Parser Plug-in to set property values. This method does not persist a new transaction in NetSuite. |
Returns |
|
Input Parameters |
None |
Parent object |
Example
var partsOfCSVLine = line.value.split(',');
var transaction = context.output.createNewTransaction();
transaction.accountStatementId = accountStatementId;
var rawDate = partsOfCSVLine[0];
transaction.date = rawDate.substring(6, 10) + '-' + rawDate.substring(0, 2) + '-' + rawDate.substring(3, 5);
transaction.amount = partsOfCSVLine[4];
transaction.transactionMappingKey = partsOfCSVLine[3];
transaction.transactionNumber = partsOfCSVLine[2];
transaction.payee = partsOfCSVLine[1];
transaction.currency = "USD";
transaction.memo = partsOfCSVLine[5];
transaction.customerRawId = partsOfCSVLine[6];
transaction.customerName = partsOfCSVLine[7];
transaction.invoices = partsOfCSVLine[8].split(',');
addTransaction
Function Declaration |
|
Type |
Object method |
Description |
The plug-in calls this method to persist the new transaction in NetSuite. |
Returns |
void |
Input Parameters |
ParsedTransaction – the new transaction to be persisted to NetSuite. |
Parent object |
Example
context.output.addTransaction({"parsedTransaction":transaction});
return true;
});
ParsedAccountStatement
Type |
Child Object |
Description |
Definition of a parsed account statement. createNewAccountStatement uses this object. |
Methods |
|
Parent Object(s) |
|
Child Object(s) |
N/A |
getAccountMappingKey
Function Declaration |
|
Type |
Object method |
Description |
This method gets the account mapping key, to associate the parsed account statements with a selected NetSuite account. |
Returns |
string |
Input Parameters |
None |
Parent object |
setAccountMappingKey
Function Declaration |
|
Type |
Object method |
Description |
This method sets the account mapping key. The account mapping key must map to a valid NetSuite account ID. The mapping can be set up in the format profile or in the Online Banking Data Upload page. This is a required field. |
Returns |
void |
Input Parameters |
accountMappingKey – The value is used to map the account statements to a NetSuite account. |
Parent object |
getStatementDate
Function Declaration |
|
Type |
Object method |
Description |
This method gets the statement date. |
Returns |
string |
Input Parameters |
None |
Parent object |
setStatementDate
Function Declaration |
|
Type |
Object method |
Description |
This method sets the account statement date. When set, the following fields are populated from the most recent imported account statement containing a statement date:
If no account statements contain a statement date, the following takes place:
Note:
If you use a default parser to upload a file without an account statement date, NetSuite uses the most recent imported transaction date to set the statement date. This date may or may not correspond to the real account statement date. The date must be in the format YYYY-MM-DD. For example, "2018-05-28". |
Returns |
void |
Input Parameters |
statementDate – the statement date |
Parent object |
getOpeningBalance
Function Declaration |
|
Type |
Object method |
Description |
This method gets the opening balance for the statement. |
Returns |
string |
Input Parameters |
None |
Parent object |
setOpeningBalance
Function Declaration |
|
Type |
Object method |
Description |
This method sets the opening balance for the statement. |
Returns |
void |
Input Parameters |
openingBalance |
Parent object |
getClosingBalance
Function Declaration |
|
Type |
Object method |
Description |
This method gets the closing balance for the statement. |
Returns |
string |
Input Parameters |
None |
Parent object |
setClosingBalance
Function Declaration |
|
Type |
Object method |
Description |
This method sets the closing balance for the statement. |
Returns |
void |
Input Parameters |
closingBalance |
Parent object |
ParsedTransaction
Type |
Child Object |
Description |
Definition of a parsed transaction. createNewTransaction uses this object. |
Methods |
|
Parent Object(s) |
|
Child Object(s) |
N/A |
getAccountStatementId
Function Declaration |
|
Type |
Object method |
Description |
This method gets the account statement ID. |
Returns |
int |
Input Parameters |
None |
Parent object |
setAccountStatementId
Function Declaration |
|
Type |
Object method |
Description |
This method sets the account statement ID, to which the transaction is associated. This record ID must belong to a valid account statement record, which NetSuite creates during the bank import process. This is a required field. |
Returns |
void |
Input Parameters |
accountStatementId – the record ID of the account statement. |
Parent object |
getDate
Function Declaration |
|
Type |
Object method |
Description |
This method gets the date for the transaction. |
Returns |
string |
Input Parameters |
None |
Parent object |
setDate
Function Declaration |
|
Type |
Object method |
Description |
This method sets the date for the transaction. The date must be in the format YYYY-MM-DD. For example, "2018-05-28". This is a required field. |
Returns |
void |
Input Parameters |
date – the date for the transaction. |
Parent object |
getAmount
Function Declaration |
|
Type |
Object method |
Description |
This method gets the amount for the transaction. In bank and credit card statements, amounts must be provided in decimal formats only, with no commas. For example, “1 000 000.00”. Negative numbers must be represented with a minus (-) sign. For example, "-100". |
Returns |
string |
Input Parameters |
None |
Parent object |
setAmount
Function Declaration |
|
Type |
Object method |
Description |
This method sets the amount for the transaction. This is a required field. |
Returns |
void |
Input Parameters |
amount – the amount for the transaction. |
Parent object |
getTransactionMappingKey
Function Declaration |
|
Type |
Object method |
Description |
This method gets the transaction mapping key. |
Returns |
string |
Input Parameters |
None |
Parent object |
setTransactionMappingKey
Function Declaration |
|
Type |
Object method |
Description |
This method sets the transaction mapping key. This transaction mapping key must map to a valid NetSuite transaction type. The mapping can be set up in the format profile or in getStandardTransactionCodes. This is a required field. |
Returns |
void |
Input Parameters |
transactionMappingKey – the mapping key. |
Parent object |
getTransactionNumber
Function Declaration |
|
Type |
Object method |
Description |
This method gets the transaction number. |
Returns |
string |
Input Parameters |
None |
Parent object |
setTransactionNumber
Function Declaration |
|
Type |
Object method |
Description |
This method sets the transaction number. |
Returns |
void |
Input Parameters |
transactionNumber |
Parent object |
getPayee
Function Declaration |
|
Type |
Object method |
Description |
This method gets the payee for the transaction. |
Returns |
string |
Input Parameters |
None |
Parent object |
setPayee
Function Declaration |
|
Type |
Object method |
Description |
This method sets the payee for the transaction. |
Returns |
void |
Input Parameters |
payee |
Parent object |
getCurrency
Function Declaration |
|
Type |
Object method |
Description |
This method gets the currency code for the transaction. |
Returns |
string |
Input Parameters |
None |
Parent object |
setCurrency
Function Declaration |
|
Type |
Object method |
Description |
This method sets the currency code for the transaction. The currency must be one of the standard currency codes. |
Returns |
void |
Input Parameters |
currency – the currency code. |
Parent object |
getMemo
Function Declaration |
|
Type |
Object method |
Description |
This method gets the memo for the transaction, if applicable. |
Returns |
string |
Input Parameters |
None |
Parent object |
setMemo
Function Declaration |
|
Type |
Object method |
Description |
This method sets the memo for the transaction, if applicable. |
Returns |
void |
Input Parameters |
memo |
Parent object |
getUniqueId
Function Declaration |
|
Type |
Object method |
Description |
This method gets the unique ID for the transaction. |
Returns |
string |
Input Parameters |
None |
Parent object |
setUniqueId
Function Declaration |
|
Type |
Object method |
Description |
This method sets the unique ID for the transaction. The unique ID automatically prevents a transaction from getting imported into NetSuite as a duplicate.
Note:
If your transactions contain a unique ID, you should always use this method to ensure the removal of duplicates. This is the case for both manual file import and financial institution connectivity. |
Returns |
void |
Input Parameters |
uniqueId |
Parent object |
getSourceId
Function Declaration |
|
Type |
Object method |
Description |
This method gets the source ID for the transaction. |
Returns |
string |
Input Parameters |
None |
Parent object |
setSourceId
Function Declaration |
|
Type |
Object method |
Description |
This method sets the source ID for the transaction.
Note:
You should only use this method for OFX files. The source ID maps to a field that is only present in OFX files called FitId. This field is used in addition to others such as amount, date, and memo during the duplicate detection process. Alone, you cannot use this field to detect duplicate transactions in OFX files. To guarantee the automatic detection and removal of duplicates before they are imported, regardless of the file format, see setUniqueId. |
Returns |
void |
Input Parameters |
sourceId |
Parent object |
getTransactionStatus
Function Declaration |
|
Type |
Object method |
Description |
This method gets the transaction status. |
Returns |
string |
Input Parameters |
None |
Parent object |
setTransactionStatus
Function Declaration |
|
Type |
Object method |
Description |
This method sets the transaction status. |
Returns |
void |
Input Parameters |
transactionStatus |
Parent object |
getCustomerRawId
Function Declaration |
|
Type |
Object method |
Description |
This method gets the customer ID for the transaction. |
Returns |
string |
Input Parameters |
None |
Parent object |
setCustomerRawId
Function Declaration |
|
Type |
Object method |
Description |
This method sets the customer ID for the transaction. |
Returns |
void |
Input Parameters |
customerRawId |
Parent object |
getCustomerName
Function Declaration |
|
Type |
Object method |
Description |
This method gets the customer name for the transaction. |
Returns |
string |
Input Parameters |
None |
Parent object |
setCustomerName
Function Declaration |
|
Type |
Object method |
Description |
This method sets the customer name for the transaction. |
Returns |
void |
Input Parameters |
customerName |
Parent object |
getInvoices
Function Declaration |
|
Type |
Object method |
Description |
This method gets the invoices associated with the transaction. |
Returns |
string |
Input Parameters |
None |
Parent object |
setInvoices
Function Declaration |
|
Type |
Object method |
Description |
This method sets the invoices associated with the transaction. |
Returns |
void |
Input Parameters |
invoices |
Parent object |