# Template Printer

A button that prints (or previews) a NetSuite template — receipt, invoice, packing slip, label, or any custom template. The block resolves variables from the current page's data, fills the template, and prints to the browser's print dialog or shows a preview first.

Use this anywhere a single click should produce a formatted document — POS receipt at end of sale, invoice from a transaction-detail page, label print from a fulfilment page, or any custom workflow that ends in a printed artifact.

## Available in

* All module types

## When to use

* Order Form pages where the user needs a receipt or invoice button next to **Submit Button**.
* Transaction-detail pages with *Print Invoice* or *Print Packing Slip* buttons.
* Fulfilment workflows where a label needs to print on demand.
* Any page where a printable document should be one-click away.

## Settings

The block opens a configuration modal that handles all of its setup:

| Setting                | Description                                                                                                                                                                                                                            |
| ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Template**           | The NetSuite template to use. Filterable by entity, workflow, module, and template type.                                                                                                                                               |
| **Location Templates** | Optional per-location template overrides. When a user's active location matches an entry here, the location-specific template is used instead of the default. Useful when each store or warehouse has its own receipt or label layout. |
| **Button Label**       | Text shown on the button. Default: *Print Template*.                                                                                                                                                                                   |
| **Show Preview**       | Whether the button opens a preview modal first (with a *Print* action inside) or sends straight to the browser print dialog.                                                                                                           |
| **Styling**            | Button variant, size, and full-width toggle — to match your page's other buttons.                                                                                                                                                      |

## How it works

1. Loads the configured template from NetSuite at render time.
2. When the user clicks the button, the block reads the current page's state (form fields, transaction data, customer record, etc.).
3. Variables in the template (`{customer.name}`, `{transaction.total}`, etc.) are substituted with live values.
4. If **Show Preview** is on, the rendered HTML opens in a preview modal with *Print* and *Cancel* actions.
5. Otherwise, the rendered HTML is sent to the browser print dialog directly.

## Examples

**POS receipt.** Drop Template Printer next to Submit Button on an Order Form. Configure the template to a *Cash Sale Receipt* template, button label *Print Receipt*, show preview true. After completing a sale, the cashier clicks Print Receipt to print to the register's receipt printer.

**On-demand invoice.** On a transaction-detail page, drop Template Printer with template *Invoice* and label *Print Invoice*. Show preview false — clicking the button goes straight to the print dialog.

**Shipping label.** On a fulfilment page, configure with a label template and label *Print Label*. The user clicks once to print the label to the configured printer.

## Common issues

* **"No template configured"** — open the configuration modal and select a template.
* **Variables show as `{name}` instead of values** — the variable name doesn't match a value on the page. Check the template's variable list against the page's available data.
* **Print dialog shows blank page** — check the template's CSS and ensure the page-state variables are populated. The preview modal helps debug this.

## Related

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Print</strong></td><td>The simpler print action — uses a fixed template without variable substitution.</td><td><a href="/pages/mqYxdkJ6tcQBcmrkBIa5">/pages/mqYxdkJ6tcQBcmrkBIa5</a></td></tr><tr><td><strong>Submit Button</strong></td><td>Often paired with Template Printer on Order Form pages.</td><td><a href="/pages/PhZ3dkc4a1LxD8vQ0aja">/pages/PhZ3dkc4a1LxD8vQ0aja</a></td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.in8sync.com/client-admin-guide/active-workflows/getting-started/action-components/template-printer.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
