You can pull data from Netsuite into your Octiv documents to create an auto-generated table.
Note: This is an example of a basic pricing table that will work if you’re using the standard fields in Netsuite. You can customize some parts of the code (shown below) to your own Netsuite instance in order to populate the table with the correct information.
Building your table
Follow these steps to create an auto-generated table:
- In an Octiv document, create a table in the Octiv editor that has three rows and as many columns as you need.
- Add the class custom_pricing (below in red).
- Add the data-source attribute (below in yellow).
- QuoteLineItems for quotes
- OpportunityLineItems for opportunities
- Define the table structure by declaring the first row a header row, the middle row the body, and the bottom row the footer (below in green)
- Fill in the table
- Type your column headers into the first row (below in light blue).
- In the middle (body) row, place the fields you want in square brackets (below in yellow). To find the correct way to reference the fields, go back to the Incoming Data configuration, copy the field names exactly as they show in the saved list. Only the fields in square brackets will be replaced.
- If you want a totals row, use the footer section (below in hot pink).
- Styling is markup based; inside the cell tag use class=”money”,”html”, “integer” or “float” (below in orange).
- Optional: Sort the order of the line items in the table (below in pink).
- data-sort=”field_name desc” (sorting is ascending by default)
- Filter the line items that will populate the table based on the value of one field from Netsuite. Filters are entirely case sensitive and have a variety of operators (=, !=, >, >=, <, <=, LIKE, NLIKE, IS BLANK, IS NOT BLANK). (below in darker blue).
- data-filter="Name LIKE 'hello world'" like must be uppercase and comparison is also case sensitive
- data-filter="Pricebook.product2.family = 'bronze'"
- If you would like separate tables for each value of the filtering field, you can copy the table multiple times and simply set each filter to a unique value.
|Name||Item Price||Quantity||Total Price|
<table style=”width: 100%;” data-source=”OpportunityLineItems”data-filter=”PricebookEntry.Product2.Family = ‘Subscription'” data-sort=”PricebookEntry.Product2.Name”>
<td class=”money” style=”text-align: center;”>[itemprice]</td>
<td class=”integer” style=”text-align: center;”>[quantity]</td><td class=”money” style=”text-align: center;”>[totalprice]</td>
<td colspan=”3″ rowspan=”1″ style=”text-align: right;”>Total Price:</td>
<td class=”money” style=”text-align: right;”>[SUM(priceperunit)]</td>
Finally, test your auto-generated table using your data from Netsuite. When you create a new document, choose the template where you added the pricing table. You should be able to click Preview and see your populated table.
Did this article help?
Please provide us your feedback below.