You can pull data from Microsoft Dynamics into your Octiv documents to create an auto-generated table.

Most clients choose to launch their Octiv documents from Opportunities. By default, Opportunities have Opportunity Products, which are what we use in our example pricing table below.

Note: This is an elaborate process and takes some getting used to. If you run into issues, please submit a ticket to our technical support team.

Creating an auto-generated table

This basic pricing table will work if you’re using the standard fields in Microsoft Dynamics. You can customize small parts of the code (shown below) to your own Microsoft Dynamics instance in order to populate the table with the correct information.

Use these steps to create an auto-generated table:

  1. In an Octiv document, create a table that has three rows and as many columns as you need.
  2. Add the data-source attribute Opportunity_Products for opportunities. (e.g., table style=”width: 100%” data-source=”opportunity_products”)
  3. Define the table structure by declaring the first row a header row, the middle row the body and the bottom row, the footer.
  4. Fill in the table
    • Type your column headers into the first row (below in gray).
    • In the middle (body) row, place the fields you want in square brackets (below in blue). 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 green),
    • Styling is markup based, inside the cell tag use class=”money” or “HTML”, “integer,” “float,” or “date”.
  5. Optional: Sort the order of the line items in the table. (e.g., table style=”width: 100%;” data-source=”opportunity_products” data-sort=” field_name desc”)
    • data-sort=”field_name desc” (sorting is ascending by default)
  6. Filter the line items that will populate the table based on the value of one field from Microsoft Dynamics. Filters are entirely case sensitive and have a variety of operators: =, !=, >, >=, <, <=, LIKE, NLIKE, IS BLANK, IS NOT BLANK (e.g., table style=”width: 100%;” data-source=”opportunity_products” data-sort=” field_name desc” data-filter=”Name LIKE ‘hello world'”).
    • data-filter="Name LIKE 'hello world'" like must be uppercase and comparison is also case sensitive
    • 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.

Rendered Table

ProductDescriptionQuantityTotal Monthly Cost
[name][description][quantity][priceperunit]
Total Price:[SUM(priceperunit)]

HTML

​<table style="width: 100%"> 
    <thead>
    <tr>
      <th>Product</th>
      <th>Description</th>
      <th>Quantity</th>
      <th>Price</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>[Name]</td>
      <td class="integer" style="text-align: center">[Quantity]</td>
      <td class="money" style="text-align: center">[priceperunit]</td>
    </tr>
  </tbody>
  <tfoot>
    <tr>
      <td colspan="3" rowspan="1" style="text-align: right">Total Price:</td>
      <td class="money" style="text-align: right">[SUM(priceperunit)]</td>
    </tr>
  </tfoot>
</table>

Did this article help?

Please provide us your feedback below.

* How helpful was this article?

If you have any additional questions and would like to be contacted by a member of our support team, please provide your email.