1

On page 176/177 of the SuiteBuilder Customisation Guide, Oracle explain how it's possible to add page breaks to tables within a template.

The example given is:

<!-- start of item table in transaction -->
<#list record.item as item>
    <#if item_index==0> <!-- Header Definition -->
        <tr>
            <th>${item.field1@label}</th>
            <th>${item.long_text_field@label}</th>
            <th>${item.field2@label}</th>
            <!-- ... -->
        </tr>
    </#if>
    <#list item.long_text_field?split("<br />") as paragraph>
        <#if desc_index==0>
            <tr>
                <td>${item.field1}</td>
                <td>${paragraph}</td>
                <td>${item.field2}</td>
                <!-- ... -->
            </tr>
        <#else>
            <tr>
                <td></td>
                <td>${paragraph}</td>
                <td></td>
                <!-- ... -->
            </tr>
        </#if>
    </#list>
</#list>
<!-- end of item table in transaction -->

However this is resulting in the following error:

enter image description here

It appears that the term desc_index is unable to be evaluated, and furthermore, the term does not appear an any other NETSuite related documentation other than here.

Is this a bug/typo/deprecated code?

dangerousdave
  • 6,331
  • 8
  • 45
  • 62

2 Answers2

2

This is a typo in the example.

List indexes in Freemarker are referenced by concatenating the list name with "_index". So, in this example, desc_index should be replaced with paragraph_index.

It appears they adapted this example from another snippet with a list name of 'desc' (probably for 'description') but neglected to update the index reference to match.

Of course, you need to change long_text_field, field1 and field2 to real fields that are available to the template for it to work.

Krypton
  • 4,394
  • 2
  • 9
  • 13
2

Addressing the title of your question...

You can add actual page breaks using the <pbr> tag. You can also set a new page layout. Please see the BFO documentation for more info. However, you probably do not want to use this to break apart a table directly unless you have logic to close and recreate the continuation of the table data. https://bfo.com/products/pdf/docs/userguide.pdf

When slicing up a table, you want to use CSS like page-break-inside: avoid; https://developer.mozilla.org/en-US/docs/Web/CSS/page-break-inside

dcrs
  • 294
  • 1
  • 4