Introduction

 

Before you start adding scripts, it is recommended that you read the Adding Scripts Overview.

Table Tags can include scripts that put into operation the following logic:

  • Showing or hiding specific table rows
  • Showing or hiding specific rows or whole tables in grouped tables
  • Sorting tables
  • Setting a row range
  • Adding page breaks
  • Adding page breaks in grouped tables

Hiding / Showing Table Rows

You can create a script that enables hiding or displaying rows in the output for a given dynamic table, based on values set in the script for specific table tag.

For example, you can create a script hiding all rows of occasional customers (Account ID=1000).  The output will display only rows with account ID different than 1000.

You can then add a TABLE COLUMN SUM script. If you add the script inside the table, the sum will include only values for accounts with Account ID different than 1000. If you add the script outside the table the sum will include all accounts.

To add a table tag script to show or hide table rows:

1. In the Data Tags/Form pane, right-click the parent Table tag and select Properties.

2.  Click New.

3.  In the Script Editor, Statements, double-click Comment and add a description of the script.

4.  Double-click If to begin the script logic. See Script Editor.

5.  In Table Actions/Visual, click either HIDE ROW or SHOW ROW to complete the logic.

6. Click Save to save the script.

7.  Click OK to close the Table Properties window.

Hiding / Showing Table Rows in Grouped Table

When you use the table grouping feature, you can add a script to show/hide specific rows in the table (SHOW / HIDE GRAPHICAL ROW) or show/hide the whole table (SHOW / HIDE ROW).

To add a table tag script to show or hide table rows:

  1.  In the Data Tags/Form pane, right-click the parent Group Table tag I_Group Table and select Properties.

3.  In the Script Editor, Statements, double-click Comment and add a description of the script.

4.  Double-click If to begin the script logic. See Script Editor.

4.  In Table Actions/Visual, click  HIDE ROW / SHOW ROW  to show/hide the whole table or HIDE GRAPHICAL ROW / SHOW GRAPHICAL ROW to show hide specific rows upon a condition.

6. Click Save to save the script.

7.  Click OK to close the Table Properties window.

Sorting Tables

The Sorting Tables feature enables you to add to Forms dynamic tables that will be sorted at runtime. You can add up to 3 sorting levels.

To add sorting, you need to add a sorting script to the table.

To add a sorting script:

1.  In the Data Tags/Form pane, right-click the parent Table tag and in the menu, select Table Properties; the Table Properties window appears.

2.  In the Table Properties window click New; the Script Editor appears.

3.  In the Script Editor, in Statements, double-click Comment and add a description of the script.

4.  Double-click If to begin the script logic. See Script Line Editor.

6.  From the Sort By dropdown list select the data tag for sorting.

7.  From the Type dropdown list select the data tag type: text, Number or date.

8.  Select the sorting direction: Ascending or Descending.

9.  You can add two more sorting levels.

10.  When you finish click OK.

11.  Click Save to save the script.

12.  Click OK to close the Table Properties window.

Setting a Row Range

If you have a table tagged with data from a Salesforce table, it is possible to create a script that defines the data from which rows (line items), appears in the output.

For example, you can define a script for any of the following:
Range 0-1  Only data from the row appears in the output
Range 2-2  Only data from the 2nd row appears in the output
Range 2-3 Only data from the 2nd and 3rd rows appears in the output
Range 4-L Only data from the 4th to the last row (unlimited number) appears in the output.

To add a table tag script for setting a row range:

1.  In the Data Tags/Form pane, right-click the parent Table tag and in the menu, select Table Properties; the Table Properties window appears.

2.  In the Table Properties window click New; the Script Editor appears.

3.  In the Script Editor, in Statements, you can double-click Comment and add a description of the script.

4.  Double-click If to begin the script logic.  See Script Line Editor.

6. Set the rows range according to your needs.

7.  Click Save to save the script.

8.  Click OK to close the Table Properties window.

Adding Page Breaks

You can create a script that enables adding page breaks in the output, for a dynamic table, based on values set in the script for a specific table tag.

To add a table tag script to create a page break:

1.  In the Data Tags/Form pane, right-click the parent Table tag and in the menu, select Table Properties; the Table Properties window appears.

2.  In the Table Properties window click New; the Script Editor appears.

3.  In the Script Editor, in Statements, double-click Comment and add a description of the script.

4.  Double-click If to begin the script logic.

5.  In Table Actions/Behavior, click INSERT PAGE BREAK to complete the logic.

Adding Page Breaks in Grouped Table

You can create a script that enables adding page breaks in grouped tables. You can add a page break before or after any Table tag in the grouped table.

To add a table tag script to create a page break in a grouped table:

1.  In the Data Tags/Form pane, right-click the Table tag I_T before / after which you want to add the break, and in the menu, select Table Properties; the Table Properties window appears.

2.  In the Table Properties window click New; the Script Editor appears.

3.  In the Script Editor, in Statements, you can double-click Comment and add a description of the script.

5. Click Save to save the script.

6.  Click OK to close the Table Properties window.