# Templates

## Templates at a glance

Templates is the configuration area where you prepare document templates for inquiry, offer,
order, RFQ, PO, and invoice work. You can review the template type, uploaded file name, and
upload date, then open the available editor or file actions for a row.

| If you need to… | Go to |
| --- | --- |
| Check the access and file prerequisites | [Before you start](#before-you-start) |
| Locate an existing template | [Find a template](#find-a-template) |
| Learn what each part of the screen does | [Understand the Templates screen](#understand-the-templates-screen) |
| Choose the action for a particular template type | [Choose the right template action](#choose-the-right-template-action) |
| Download, upload, or edit a template | [Maintain and use a template](#maintain-and-use-a-template) |
| Diagnose a failed template action | [When a template action fails](#when-a-template-action-fails) |
| Continue into document work | [Continue with the document workflow](#continue-with-the-document-workflow) |
| Work with offers | [Offers](doc:offers) |
| Work with orders | [Orders](doc:orders) |
| Work with purchasing RFQs | [Purchase job RFQs](doc:purchase-job-rfqs) |
| Work with purchasing orders | [Purchase job orders](doc:purchase-job-orders) |
| Work with invoices | [Create an invoice](doc:create-invoice) |

The Templates screen is at `/configuration/templates`.

![The Templates grid with its three headers and available document actions.](https://atloriaassets.blob.core.windows.net/assets/a438221c-c1af-407c-b9e6-a56c986db846/19cfe0eb19e59cbfedc8b22b5e4eb16d.png)

## Before you start

**Prerequisites**

- The Word Templates feature is included in your subscription.
- To upload the list of variables, you have developer access.
- For a company template upload, have a `.doc` or `.docx` file ready.
- For a variable-list upload, have a `.pdf` file ready.

The available action also depends on the template row. Check the row type before choosing an
editor, download, or upload action.

## Find a template

Use the Templates list to identify an existing template before opening an action. The list shows
the template type, the uploaded file name, and the upload date.

**Prerequisites**

- You have access to the Templates screen.
- You know the document type or file name you want to review.

**Steps**

1. Open `/configuration/templates`.
2. Read the **Template** column to identify the document type.
3. Read the **Uploaded file name** column to identify the stored file.
4. Read the **Uploaded on** column to identify when the file was uploaded.
5. Note the document type and identify its matching option in **Choose the right template action**.

![The Templates list identified by its three column headers](https://atloriaassets.blob.core.windows.net/assets/a438221c-c1af-407c-b9e6-a56c986db846/26d34b5d8351e62ef04f8fb8e62d60d2.png)

**Result:** The template row and its document type are identified. Continue to [Choose the right
template action](#choose-the-right-template-action).

## Understand the Templates screen

The template list is the starting point for reviewing a row. Each row can also show a
document-specific email-template option, such as **Offer E-mail Template** or **Invoice E-mail
Template**.

| Screen area | What you use it for |
| --- | --- |
| **Template** | Identify the document type. |
| **Uploaded file name** | Identify the stored file. |
| **Uploaded on** | Compare upload dates. |
| Available email-template control | Open the editor for the document type shown in the row. |
| Upload popup | Select a file for a company template or variable list. |
| HTML Template Editor | Edit template content and insert variables. |

The upload surfaces use one file field. The company-template surface accepts `.doc` and `.docx`;
the variable-list surface accepts `.pdf`. The editor uses rich text and shows **Type # to insert
a variable**.

When the editor opens, its dialog is titled **HTML Template Editor**. Its visible controls include
the following toolbar actions:

| Editing need | Controls |
| --- | --- |
| Change text formatting | **Bold**, **Italic**, **Underline**, **Font Color**, **Background Color** |
| Change alignment and lists | **Align Left**, **Align Center**, **Align Right**, **Ordered List**, **Bullet List**, **Header** |
| Work with tables | **Insert Table**, **Delete Table**, **Insert Row Above**, **Insert Row Below**, **Delete Row**, **Insert Column Left**, **Insert Column Right**, **Delete Column** |
| Reverse or repeat an edit | **Undo**, **Redo** |
| Save the editor | **OK** |

![The HTML Template Editor with its variable instruction and editing toolbar](https://atloriaassets.blob.core.windows.net/assets/a438221c-c1af-407c-b9e6-a56c986db846/102a11d2dda3d7c7c310ac3602878d16.png)

## Choose the right template action

Use the email-template option that matches the document type in the table below.

| If the row is… | Choose… |
| --- | --- |
| Inquiry | **Inquiry E-mail Template** |
| Technical or commercial offer | **Offer E-mail Template** |
| Order confirmation | **Order E-mail Template** |
| Purchase inquiry | **RFQ E-mail Template** |
| Purchase order | **PO E-mail Template** |
| Commission or sales invoice | **Invoice E-mail Template** |
| Inspection sheet | No document-specific editor action is available in this screen. |

For rows other than Inquiry, open the row menu to use **Sample template**, **Company template**,
**Upload company template**, or **List of variables**. **Company template** is available for
download only when the row has a company template; when the row is a basic template, that action
is disabled.

## Maintain and use a template

Choose one procedure after you have selected the document type and its matching option.

### Download a template or the variable list

**Prerequisites**

- You have identified the template row.
- The row is not an Inquiry when using the row menu actions.

**Steps**

1. Open the row menu.
2. Choose one action from the table.

| If you need to… | Choose… |
| --- | --- |
| Download the standard file | **Sample template** |
| Download the company file | **Company template** |
| Download the variable list | **List of variables** |
| Download the variable list from the instructions | **click here to download the list of variables.** |

**Result:** The selected download action starts from the template screen.

### Upload a company template

**Prerequisites**

- You have a `.doc` or `.docx` file ready.
- You have identified a non-Inquiry template row.

**Steps**

1. Open the row menu.
2. Select **Upload company template**.
3. Select **Browse**.
4. Choose the company template file.
5. Select **Upload**.

**Result:** The upload popup closes after the upload path completes.

### Edit a document template

**Prerequisites**

- You have identified the row's document type.
- You have selected its document-specific editor action.

**Steps**

1. Select the document-specific email-template action for the row.
2. Edit the content in **HTML Template Editor**.
3. Type `#` to insert a variable.
4. Select **OK** to save the editor content.

**Result:** The editor closes after the save path completes.

### Upload the list of variables

**Prerequisites**

- You have developer access.
- You have a `.pdf` file ready.

**Steps**

1. Select **Upload list of variables**.
2. Select **Browse**.
3. Choose the PDF file.
4. Select **Upload**.

**Result:** The variables upload popup closes after the upload path completes.

If an action fails, use [When a template action fails](#when-a-template-action-fails).

## When a template action fails

Use this table when a template action does not complete as expected.

| What you see | What it means | What to do |
| --- | --- | --- |
| `An error occurred while processing your request` while the list loads | Loading the template list failed. | Return to the Templates screen and retry the load. |
| `An error occurred while processing your request` after a download action | The requested file download failed. | Retry the same download action. |
| `An error occurred while processing your request` after an upload action | The upload request failed. | Check the file type and retry the upload. |
| `An error occurred while processing your request` after saving the editor | Saving the template content failed. | Reopen the editor and retry the save. |
| The expected document action is not clickable | The action is not available from the current row or screen state. | Recheck the row type and use the matching action in [Choose the right template action](#choose-the-right-template-action). |

## Continue with the document workflow

After you maintain the relevant template, continue with the document workflow that uses it. The template
screen provides actions for inquiry, offer, order, RFQ, PO, and invoice documents. Continue with
the workflow that matches the document you are preparing.

| If you are continuing with… | Go to |
| --- | --- |
| Offers | [Offers](doc:offers) |
| Orders | [Orders](doc:orders) |
| Purchasing RFQs | [Purchase job RFQs](doc:purchase-job-rfqs) |
| Purchasing orders | [Purchase job orders](doc:purchase-job-orders) |
| Invoices | [Create an invoice](doc:create-invoice) |

**Result:** You have a maintained template and a workflow page for the document type you need.
