Advanced Template Tips and Tricks
Following are some tips and tricks to help you create advanced templates:
Removing CRLF (End of Line) Character
If you want to remove the CRLF or end of line character at the end of the output, use the FreeMarker tag <#rt>
. For example, from the initial template:
Template
#OUTPUT START#
ABC
#OUTPUT END#
Output

If you do not want to include a CRLF character to denote the end of a line in the output, place the #OUTPUT END#
tag right after the last character in the template. Using the <#rt>
FreeMarker tag:
Template:
#OUTPUT START#
ABC<#rt>
#OUTPUT END#
Output:

Getting IDs from Select Fields
Accessing a select field from a record or search result returns the text of that select field. To get the ID, append .internalId
when accessing the field.
Computing for the Sequence ID
Using the getSequenceId(forTodaySequenceOnly) function, you can create your own function to compute for the sequence ID on generated PFA records. Refer to a basic sample function using getSequenceId(true):
<#function computeSequenceId>
<#assign lastSeqId = getSequenceId(true)>
<#assign newSeqId = lastSeqId + 1>
<#return newSeqId>
</#function>
At the end of the template, after the #OUTPUT END#
tag, add a return for the last sequence ID that was used to update the sequence ID:
#RETURN START#
sequenceId:${newSeqId}
#RETURN END#
Debugging Template Errors
If the output file is not created successfully when using FreeMarker as the template engine, the Payment File Administration page shows a status of Processed with Errors, with details indicating that the system failed to render the payment file template.
This error is caused by one of the following conditions:
-
The Advanced PDF/HTML Templates feature is not enabled.
-
The template contains incorrect syntax.
-
Missing parenthesis in conditionals that use < or >.
Incorrect:
<#if a > b > </#if>
Correct:
<#if (a > b) > </#if>
-
Misplaced slash in FreeMarker expression end tags.
Incorrect:
<#if greeting == "hello" > <#/if>
Correct:
<#if greeting == "hello" > </#if>
-
-
One or more entity records have an issue.
The following error message is displayed: “EP_00017. Entity records have issues....” View the execution log to get more details about the error and the list of entities with issues. Go to Customization > Scripting > Script Deployments. Under the Script column, look for the Generic Payment Processing record with ID, customdeploy_2663_payment_processing_ss, and open its record by clicking the View link. On the record, the list of entities with issues are listed under the Execution Log subtab.
Here are the possible reasons for this error:
-
Issue: Inactive entity
Action: View the entity record to verify the status and update, if necessary.
-
Issue: The entity payment box is not checked
Action: On the Bank Payment Details tab of a vendor or employee record, verify that the EFT Bill Payment box is checked. For customer records, under the Bank Payment Details (Debit) tab, verify that the Direct Debit box is checked.
-
Issue: The company bank format is changed
Action: View the Company Bank Details record to verify the details for the EFT or DD Template.
-
Issue: Entity bank has a different format from the company bank (possibly due to CSV import)
Action: Verify that the format on the bank payment details of the entity record is the same as the EFT or DD Template details on the company bank record.
-
Issue: Entity bank record is removed
Action: View the Bank Payment Details of a vendor or employee record to verify that the primary entity bank record is still listed under the Entity Bank Details subtab. In case it is not listed, you must create a new one and set the type to Primary. Do the same for customer records, on the Bank Payment Details (Debit) tab.
-
Related Topics
- FreeMarker Template Library for Electronic Bank Payments
- Functions
- Data
- Working with Advanced Templates
- Defining Start and End Tags in Advanced Templates
- Including Fields from NetSuite Search Results in Advanced Templates
- FreeMarker Template Library for Electronic Bank Payments
- Advanced Template Snippets
- Creating Custom Payment File Templates
- Creating a New Custom Payment File Template