> ## Documentation Index
> Fetch the complete documentation index at: https://support.fieldko.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Set Up Turn-In Orders

> Enter your wholesaler credentials, review the connector settings, prepare store and product data, and check the jobs that send turn-in orders.

Use this page to get turn-in orders working in your org, or to check the setup when orders aren't being sent. For how orders move through the connector, see [How Turn-In Orders Work](https://support.fieldko.com/admin/turn-in-orders/overview.md).

## User Permissions Needed

| To do this | You need |
| - | - |
| Enter credentials and change connector settings | Customize Application |
| Check scheduled jobs | View Setup and Configuration |
| Add the **Retry … Send** action to record pages | Customize Application |
| Let more users retry orders | Manage Profiles and Permission Sets |

## Before You Begin

* FieldKo has installed the turn-in order connector in your org.
* You have your wholesaler's B2B account name and password.
* You have the values your wholesaler supplied during onboarding: the application code, business pillar, pillar ID, and order type.

## Enter the Wholesaler Credentials

The wholesaler's B2B account name and password are stored in a protected custom setting, entered by an admin in each org. They're never stored in metadata or source control.

1. From Setup, in the Quick Find box, enter `Custom Settings`, and then select **Custom Settings**.
2. Next to the connector's credential setting, click **Manage**.
3. Edit the org default value, enter the B2B account name and password, and then save.

The connector reaches the wholesaler through 2 named credentials, one for test and one for production. They don't hold the account name or password, because the connector sends those inside each order.

## Review the Connector Settings

The connector reads its settings from the **Default** record of its custom metadata type. Changes take effect on the next run, with no deployment.

1. From Setup, in the Quick Find box, enter `Custom Metadata Types`, and then select **Custom Metadata Types**.
2. Next to the connector's config type, click **Manage Records**.
3. Next to **Default**, click **Edit**.

| Setting | What It Does | Default |
| - | - | - |
| **Named Credential** | Chooses the test or production endpoint. Switch to production when you go live. | Test |
| **Application Code**, **Business Pillar**, **Pillar Id**, **Order Type** | Values supplied by your wholesaler | Set at onboarding |
| **Batch Scope** | Orders sent per transaction | `1` |
| **Max Retries** | How many times FieldKo automatically retries a **Send Failed** order | `3` |
| **Is Active** | Turns sending on or off | Selected |
| **Send Failure Emails** | Turns the failure summary email on or off | Selected |
| **Notification Emails** | Extra recipients for the failure summary email. Separate addresses with commas or semicolons. | Blank |
| **PDF Notification Emails** | Extra CC recipients on every order confirmation email | Blank |

## Prepare Store and Product Data

Most failed sends come from store or product data. Check these fields before you go live.

| Record | Field | What It Needs |
| - | - | - |
| Account (store) | **Account Number** | The wholesaler's store number, 8 to 10 digits, including leading zeros |
| Account (store) | **Shipping State** | A state that maps to the wholesaler's region code 01 to 09 |
| Product | The wholesaler product code | The wholesaler's 14-digit code, on **every** product reps can order |
| Price book entry | **Unit Price** and units per case | Orders are sent in cases or cartons |

> [!WARNING]
>
> Store numbers lose their leading zeros when you edit them in a spreadsheet. Format the column as text before you import, or every affected order fails the 8-digit check.

## Check the Scheduled Jobs

2 jobs run every 15 minutes. The send job runs 5 minutes before the PDF job, so each sent order gets its confirmation on the next PDF run.

| Job | Runs At |
| - | - |
| Send orders to the wholesaler | :10, :25, :40, and :55 past each hour |
| Create and email confirmation PDFs | :00, :15, :30, and :45 past each hour |

* From Setup, in the Quick Find box, enter `Scheduled Jobs`, and then select **Scheduled Jobs**. Check that both jobs are listed, 4 schedules each.

To deploy changes to the PDF classes while their jobs are scheduled, either select **Allow deployments of components when corresponding Apex jobs are pending or in progress** in **Deployment Settings**, or unschedule the jobs, deploy, and then schedule them again.

## Add the Retry Action

**Retry … Send** lets an admin send a failed order straight away. Add it to the record pages admins use:

1. Open a FieldKo order record, click the gear icon, and then select **Edit Page**.
2. Select the highlights panel, add **Retry … Send** to its actions, and then save. If the panel uses the page layout's actions, add the action to the layout's **Salesforce Mobile and Lightning Experience Actions** section instead.
3. Repeat for an integration log record.

## Optional: Let More Users Retry Orders

By default, only admins can use **Retry … Send**. To let other users retry, give their permission set **Apex Class Access** to the connector's order service class.

Reps and managers don't need extra setup to see turn-in orders. The **FieldKo Representative Permission Set** and **FieldKo Manager Permission Set** include access to the turn-in order fields and read access to the integration log.

**To confirm:** Create a test order for a wholesaler store using the test endpoint, and sync. Within 15 minutes, the order's status is **Sent**, its transmission number is filled in, and the integration log has a **Success** record for it.

## See Also

* [How Turn-In Orders Work](https://support.fieldko.com/admin/turn-in-orders/overview.md)
* [Turn-In Order Checks and Messages](https://support.fieldko.com/admin/turn-in-orders/checks-and-messages.md)
* [Troubleshoot Turn-In Orders](https://support.fieldko.com/admin/turn-in-orders/troubleshoot.md)
* [Set Up Products, Ordering, and Ranging](https://support.fieldko.com/admin/products-ordering-ranging.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.