Functions
The Electronic Bank Payments SuiteApp uses the following functions in payment file templates.
Function Declaration |
Description |
---|---|
Builds the entity name |
|
Adds all payment amounts |
|
Converts a string into its Latin equivalent |
|
Formats a particular amount to be inserted into the payment file |
|
Returns the raw sequence ID from search of the PFA record |
|
Removes the specified ending from a string value |
|
Sets the fixed length for a string value |
|
Sets a maximum length for a string value |
|
Puts a padding to a string value |
|
Returns the 3–digit ISO currency symbol for the specified currency name |
|
Returns the two-letter country code for the cpecified country |
|
Returns a payment amount considering multiple currencies, base currency, and bank currency |
|
Encloses the specified string in between the specified enclosing character if it contains the specified escape character |
|
Returns the state code for the specified state. State code that will be retrieved depends on the Country set under the Company Information page. If the Country does not have states, the function will return a blank value. |
|
Returns the total applied credits amount of the payment record considering multiple currencies, base currency and bank currency. |
|
Returns total payment and applied credits amount of the payment record considering multiple currencies, base currency and bank currency. |
buildEntityName(entity,isPrintOnCheckAs)
Builds the entity name of a vendor, customer, or employee.
Parameters
-
entity – single entity search result object
-
isPrintOnCheckAs – flag to prioritize the printoncheckas entity field
-
Accepts Boolean values
true
orfalse
-
Default value is
true
-
Returns
-
String containing the entity name
Example
Sample entity search result objects:

Commands
The first set prioritizes the printoncheckas field and the second set does not.
<#list entities as entity>
${buildEntityName(entity,true)}
</#list>
<#list entities as entity>
${buildEntityName(entity,false)}
</#list>
Output


computeTotalAmount(payments,multiCurrency)
Adds all payment amounts.
Parameters
-
payments – sequence of payment search results to be processed
-
multiCurrency – flag for multi-currency formats
Default value is
false
Returns
-
Computed total amount of payments
Example
Sample payment search result objects for a single currency format:

Commands
${computeTotalAmount(payments)}
Output

convertToLatinCharSet(data)
Converts a string into its Latin equivalent.
Parameters
-
data – string to be processed
Returns
-
String using Latin character set
Example
Commands

Output

formatAmount(amount,format,separator)
Formats a specified amount to be inserted into the payment file.
Parameters
-
amount – amount to be formatted
-
Whole numbers or rational numbers
-
Maximum of two decimal places
-
-
format – the format to be used
-
Accepts any one of the following values –
dec
,noDec
,truncDec
ordecLessThan1
-
Default value is
noDec
-
dec
anddecLessThan1
– absolute value, then round to two decimal places -
noDec
– absolute value, then remove the decimal point -
truncDec
– absolute value, then remove the decimal portion -
currency
– absolute value, round to two decimal places and retain comma symbol
-
-
separator – used to split the integer portion and the decimal portion
-
Default value is “.”
-
Available for
dec
andcurrency
format
-
Returns
-
String with formatted amount
Example
Commands
${formatAmount(-100.50,"dec")}
${formatAmount(100.50,"noDec")}
${formatAmount(100.50,"decLessThan1")}
${formatAmount(-100.50,"truncDec")}
${formatAmount(-1000.50,"currency")}
${formatAmount(100.50,"dec",",")}
${formatAmount(1234.50,"currency",".")}
${formatAmount(0.50,"currency",".")}
${formatAmount(123.45,"currency",".")}
${formatAmount(1234567.89,"currency",".")}
${formatAmount(-1234567.89,"currency",".")}
Output


getSequenceId(forTodaySequenceOnly)
Returns the raw sequence ID from search of the PFA record.
This function can be used for EFT and Direct Debit transactions only. Currently, it is not available for Positive Pay transactions.
Parameters
-
forTodaySequenceOnly – flag to filter today’s PFA records only
Accepts Boolean values
true
orfalse
Returns
-
Sequence ID number based on PFA search results
Example
Sample PFA search results for yesterday:

Sample PFA search results for today:

Commands
The first line gets the sequence ID for today only, and the second line gets the sequence ID covering all dates.
${getSequenceId(true)}
${getSequenceId(false)}
Output

For a sample implementation of this function, see Computing for the Sequence ID.
removeEnding(data,removeString)
Removes the specified ending from a string value.
Parameters
-
data – string to be processed
-
removeString – string to be removed from the ending of the data
Returns
-
String with removed ending
Example
Command
${removeEnding("abcdef","def")}
Output

setLength(data,length)
Sets the fixed length for a string value.
Parameters
-
data – string to be processed
-
length – fixed length to be set
Spaces are added if data length is less than the set length.
Returns
-
String with fixed length
Example
Commands
The following commands cover setting length of data with varying lengths:
***${setLength("abcde",3)}***
***${setLength("a",3)}***
***${setLength("a",3,"right")}***
Output

setMaxLength(data,maxLength)
Sets a maximum length for a string value.
Parameters
-
data – string to be processed
-
maxLength – maximum length to be set
Returns
-
String with acceptable length
Example
Commands
The following commands cover setting max length of data with varying lengths:
***${setMaxLength("abcde",3)}***
***${setMaxLength("a",3)}***
Output

setPadding(data,padSide,padChar,length)
Puts a padding to a string value.
Parameters
-
data – string to be processed
-
padSide – the side on which the padding is to be inserted
Accepts values
left
orright
-
padChar – the character padding to be inserted
-
length – length to be set
If length is less than data, data is truncated depending on the padSide value. For
left
padding, truncation is applied on the left side. Forright
padding, truncation is applied on the right side.
Returns
-
String with character padding
Example
Commands
The following commands cover all padding options for data with varying lengths:
${setPadding("abcde","left","0",10)}
${setPadding("abcde", "right", "0", 10)}
${setPadding("abcde", "right", "0", 3)}
${setPadding("abcde", "left", "0", 3)}
Output

getCurrencySymbol(currencyName)
Returns the 3–digit ISO currency symbol for the specified currency name.
Parameter
-
currencyName – name in NetSuite currency record
Returns
-
String that contains the currency symbol
Example
Command
${getCurrencySymbol("USA")}
Output

getCountryCode(country)
Returns the two-letter country code for the specified country.
Parameter
-
country – name of country
Return
-
String that contains the country code
Example
Command
${getCountryCode("Philippines")}
Output

getAmount(payment,multiCurrency)
Returns a payment amount considering multiple currencies, base currency, and bank currency
Parameters
-
payment – payment search result object
-
multiCurrency – flag for multi-currency format
Returns
-
Payment amount
Examples
Command
The following command is applied to the following sample scenarios:
-
Scenario 1 – Single currency format and payment amount of 100
-
Scenario 2 – Multicurrency format, base currency not equal to the bank currency, payment amount of 100, fxamount field with value of 200, and formula currency amount of 300
-
Scenario 3 – Multicurrency format, base currency equal to the bank currency, payment amount of 100, fxamount field with value of 200, and formula currency amount of 300
${getAmount(payment)}
Output

encloseString(str,maxLength,escapeChar,enclosingChar)
Encloses the specified string in between the specified enclosing character if it contains the specified escape character
Parameters
-
str – the string to be checked
-
maxLength – the maximum length of the string including the enclosing characters
-
escapeChar – the character to check for
-
enclosingChar – the character used to enclose the string
Returns
-
A string enclosed between the closing characters if it contains the escape character
Examples
Commands
${encloseString("abc^def",5,"^","@")}
${encloseString("abc^def",9,"^","@")}
${encloseString("abcdef",11,"^","@")}
Output

getStateCode(state)
Returns the state code for the specified state. This function is only applicable if Country is set to the United States on the Company Information page. Otherwise, the function will return a blank value.
Parameter
-
state – name of the state
Returns
String containing the state code
Example
Command
${getStateCode("Alabama")}
Output

getAppliedCreditsAmount(payment,multiCurrency)
Returns total of all the applied credits amount of the given payment record considering multiple currencies, base currency and bank currency.
Parameters
-
payment – payment search result
-
multiCurrency – flag for multi-currency format. The default value is false.
Returns
-
Total applied credits amount.
Example
Command
The following command is applied to the following sample scenarios:
-
Scenario 1 – Single currency format and credits amount of 100
-
Scenario 2 – Multi-currency format, base currency not equal to the bank currency, credits amount of 100, foreignAmount field with value of 200, and formula currency amount of 300
-
Scenario 3 – Multicurrency format, base currency equal to the bank currency, credits amount of 100, foreignAmount field with value of 200, and formula currency amount of 300
${getAppliedCreditsAmount(payment)}
${getAppliedCreditsAmount(payment, true)}
${getAppliedCreditsAmount(payment, true)}
Output

getAggregateAmount(payment,multiCurrency)
Adds and returns total payment amount and applied credits amount of the required payment record considering multiple currencies, base currency and bank currency.
Parameters
-
payment – payment search result
-
multiCurrency – flag for multi-currency format. The default value is false.
Returns
-
Calculated total payments and applied credits amount.
Examples
-
Single currency format and payment amount of 40 along with credits amount of 20
Command
${getAggregateAmount(payment)}
Output
