getAccounts()
Function Declaration |
|
Type |
Interface function |
Description |
Retrieves all available accounts from a financial institution. This function enables you to link bank or credit card accounts to corresponding general ledger accounts in NetSuite. The function is invoked when you open the Account Linking subtab on a Bank Reconciliation format profile record, or when bank data is imported into NetSuite. To add a financial institution account, see addAccount(). |
Returns |
void |
Input Parameters |
context – a JavaScript object with the following properties: |
Example
function getAccounts(context)
{
var configurationId = context.pluginConfiguration.getConfigurationFieldValue({fieldName: "configuration_id"});
var configuration = loadConfiguration(configurationId)
context.addAccount({
accountMappingKey: "12345",
displayName: "Checking (XXXX11)",
accountType: "BANK",
currency: "USD",
groupName: "Bank of America",
lastUpdated: "2020-06-30T01:23:45"
});
}
If you want the plug-in to initiate a bank data import retry, make sure isRetryAllowed() is true and then call retry().
if (context.isRetryAllowed()) {
context.retry({deltaMinutesLater: 30, currentFailureReason: "Timed out"});
}
Reasons why you may want to initiate an import retry can include the following:
-
Your financial institution goes down.
-
There is too much data.
-
There was a time-out for the import.
An import retry is initiated during the import process. retry() causes the current import job to be marked as failed, and then initiates a retry.