Outer table and inner table
This topic explains the structure and components of nested tables in invoices, detailing the roles of outer and inner tables, and the use of merge fields.
The nested table in invoices consists of one or more outer tables and an inner table.
For example:
Outer table
Defines the scope of the outer table. You can have an outer table inside another outer table.
The outer table includes:
-
TableStartandTableEndmerge fields.-
If the outer table is an outermost table (Outer table 1):
{MERGEFIELD TableStart:<objectName> \* MERGEFORMAT} -
If the outer table has a parent table (Outer table 2 and Outer table 3):
{MERGEFIELD TableStart:<objectName>_<xx> \* MERGEFORMAT}The object referenced in theTableStartandTableEndmerge fields is the object name referenced in the outer table appended with_xx, where xx represents any non-empty alphanumeric string. Once the outer table object is defined, reference it consistently when inserting other merge fields in the outer table. For example, follow a sequential numbering convention for the nested table and use 01:InvoiceItem_01.ListPrice.
-
-
NestedTable:GroupColumnmerge field used to group the data. -
NestedTable:ValueColumnmerge field used to calculate the subtotal. -
Merge field used to display the subtotal of the
ValueColumn. -
TableSortmerge field used to sort order for data. -
In an outer table, you are not allowed to use the same field for both
GroupColumnandValueColumnmerge fields.
When specifying merge fields for nested tables in your template document, use double quotes for merge fields that contain spaces. For example: {MERGEFIELD "NestedTable:GroupColumn Usage.BillingCode__c" \* MERGEFORMAT}
Inner table
Defines the line items that appear in the table nested inside the outer table. The inner table includes:
-
TableStartandTableEndmerge fields. The object referenced in theTableStartandTableEndmerge fields is the object name referenced in the outer table appended with_xx, where xx represents any non-empty alphanumeric string. For example:{MERGEFIELD TableStart:<objectName>_<xx> \* MERGEFORMAT}Once the inner table object is defined, reference it consistently when inserting other merge fields in the inner table. For example, follow a sequential numbering convention for the nested table and use 01:InvoiceItemor_01.ListPriceUsage_01.Quantity. -
You cannot include the
GroupColumnmerge field and subtotal amount of theValueColumnmerge field in the inner table scope. -
TableSortmerge field used to sort order for data.