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

# Configuring Statements

> Grant permission set access, add the Statement quick actions to page layouts, and set the Custom Metadata that controls Statement Manager defaults and cleanup.

## Overview

Most of what makes Statements work — the object, its fields, its tabs — ships ready to use. As an administrator, you still need to grant access, put the quick actions on page layouts, and decide a handful of defaults through Custom Metadata.

## Prerequisites

* Access to **Permission Sets**, **Object Manager**, and **Custom Metadata Types** in Salesforce Setup.

## Granting Access to Statements

Statement and Statement Financial Event access is granted through the same permission sets that control other Commerce objects:

* `FC_Commerce_View_Business_Data` — read access to Statements, Statement Financial Events, and their fields.
* `FC_Commerce_Manage_Business_Data` — create/edit access to Statements, Statement Financial Events, and their fields.

> [!WARNING]
>
> A permission set named `FC_Commerce_Manage_Statements` also ships with the package, but it currently carries no field or object grants. Assign `FC_Commerce_Manage_Business_Data` (and `FC_Commerce_View_Business_Data` for read-only staff) to grant Statement access — don't rely on `FC_Commerce_Manage_Statements` alone.

## Adding the Quick Actions to Page Layouts

The Statement quick actions ship in the Commerce package itself. The page layouts for Account, Contact, Statement, and Statement Financial Event ship from the fusionCore Layouts package. The table below summarizes which quick actions go to which object page layouts.

| Quick Action | Add to the page layout for |
| - | - |
| **Create Statement** | Account, Contact |
| **Manage** | Statement |
| **Pay** | Statement |
| **Refund** | Statement, Statement Financial Event |
| **Cancel Statement** | Statement |
| **Set Statement Status to Open** | Statement |
| **Set Statement Status to Pending Payment** | Statement |
| **Approve**, **Decline** | Statement Financial Event |

The instructions below cover how to add them if they are missing.

**1. Open the page layout**

In **Setup → Object Manager**, open the object (Account, Contact, Statement, or Statement Financial Event), then open **Page Layouts** and select the layout you want to edit.

**2. Add the quick action**

Drag the quick action from the palette into the **Salesforce Mobile and Lightning Experience Actions** section, then save the layout.

Statement and Statement Financial Event tabs ship with the package — add them to the relevant Lightning apps' navigation if you want staff to browse Statements directly rather than only reaching them from an Account, Contact, or Order.

## Custom Metadata Settings

Statement behavior is tuned through `FCORE_BASE__Constant__mdt` records, reached at **Setup → Custom Metadata Types → Constant → Manage Records**.

### Field Set Constants

Two field sets on the Statement object drive the Statement Manager UI, named in the two Constant records below:

* `FCORE_PAY__Statement_Manager_Highlighted` — the fields shown in the Statement Manager's header (Name, Statement Customer, Statement Date, Statement Business Unit, Prevent Paying On Orders by default).
* `FCORE_PAY__Statement_Manager_Settings` — the fields shown in the Statement Settings modal, including the address fields.

Edit either one in **Setup → Object Manager → Statement → Field Sets**, or build your own field set and point the matching Constant's `FCORE_BASE__Text_Value__c` at it, to change what the Statement Manager shows.

| Constant | Purpose | Shipped Value |
| - | - | - |
| `Statement_Manager_Highlighted_Fields` | The field set the Statement Manager header uses to display key fields. | `FCORE_PAY__Statement_Manager_Highlighted` |
| `Statement_Manager_Settings_Fields` | The field set the Statement Settings modal uses. | `FCORE_PAY__Statement_Manager_Settings` |

### Behavior Constants

The remaining four settings control how Statements behave in the system — the **Value When No Record Exists** column are the OOTB values that come shipped with the package - they are also the values that the system falls back to IF the custom metadata records do not exist. If the constant is missing, create a new `FCORE_BASE__Constant__mdt` record with the exact name below to override one:

| Constant to Create | Purpose | Field to Set | Value When No Record Exists |
| - | - | - | - |
| `FC_Statement_Pay_Auto_Convert_To_Invoice` | When checked, a Quote-type Order receiving a partial Statement payment converts to an Invoice automatically using today's date, instead of prompting staff for an invoice date. | `FCORE_BASE__Checkbox_Value__c` | Unchecked |
| `FC_Use_Customer_Currency_New_Statement` | When checked (and your org uses multiple currencies), a new Statement created from an Account or Contact defaults to that customer's currency. | `FCORE_BASE__Checkbox_Value__c` | Unchecked |
| `FC_Stale_Statement_Deletion_Age_Days` | How many days a Draft Statement with no financial activity can sit before the stale-Statement job deletes it. | `FCORE_BASE__Integer_Value__c` | `30` |
| `FC_Stale_Statement_Deletion_Batch_Size` | The batch chunk size the stale-Statement deletion job processes at a time. | `FCORE_BASE__Integer_Value__c` | `200` |

The `FC_Set_Payment_Amount_To_Balance_Due` constant, also used on Order payments, applies to the Statement payment screen as well — when checked, it pre-fills the payment amount with the Statement's balance due. Like the four settings above, it ships with no Constant record — create one with `FCORE_BASE__Checkbox_Value__c` checked to turn it on.

## Field Sets

Two field sets on the Statement object drive the Statement Manager UI, named in the two Constant records above:

* `FCORE_PAY__Statement_Manager_Highlighted` — the fields shown in the Statement Manager's header (Name, Statement Customer, Statement Date, Statement Business Unit, Prevent Paying On Orders by default).
* `FCORE_PAY__Statement_Manager_Settings` — the fields shown in the Statement Settings modal, including the address fields.

Edit either one in **Setup → Object Manager → Statement → Field Sets**, or build your own field set and point the matching Constant's `FCORE_BASE__Text_Value__c` at it, to change what the Statement Manager shows.

## The Stale Statement Deletion Job

A scheduled job named **FC: Delete Stale Statements** runs daily at midnight and is registered automatically when the package installs. It deletes **Draft** Statements older than `FC_Stale_Statement_Deletion_Age_Days` — unless the Statement has **Prevent Automated Deletion** checked, or it already has financial events recorded against it.

> [!TIP]
>
> Check **Prevent Automated Deletion** on any Draft Statement you're intentionally leaving unfinished for a while — for example, one you're building up over several sessions before you send it.

### Confirm the Job Is Scheduled

Check **Setup → Scheduled Jobs** for **FC: Delete Stale Statements**. See [Scheduled Jobs in fusionCore](https://docs.fusioncore.us/end-user-guides/platform-setup/scheduled-jobs-in-fusioncore.md) for the general pattern fusionCore jobs follow.

If it's missing, schedule it yourself:

**1. Open the Developer Console**

Click the **Settings gear** in the top right, then **Developer Console**.

**2. Open the Execute Anonymous window**

Go to **Debug → Open Execute Anonymous Window**.

**3. Run the scheduler**

Clear any existing code, paste the line below, and click **Execute**.

```java theme={null}
FCORE_PAY.DeleteStaleStatementsBatchScheduler.schedule();
```

This schedules the job with the default cron expression `0 0 0 * * ?` (daily at midnight) — re-check **Setup → Scheduled Jobs** afterward to confirm it now appears.

## Multi-Currency Considerations

If your org uses multiple currencies:

* A Statement's currency is locked as soon as it has a linked Order — changing it afterward returns `Currency cannot be changed on a Statement that has linked Orders.`
* An Order can only be linked to a Statement whose currency matches the Order's own currency.
* Enable `FC_Use_Customer_Currency_New_Statement` if you want new Statements to default to the customer's currency instead of your org's default currency.

## Limitations and Common Pitfalls with Statement Configuration

* **Quick actions don't appear until added to a layout.** All Statement and Statement Financial Event quick actions ship with the package but need to be placed on the relevant page layout before staff see them.
* **The stale-deletion job only ever removes Draft Statements.** An Open or later-status Statement is never touched by it, regardless of age.
* **A Statement with any financial event is never auto-deleted**, even if it's still in Draft and past the age threshold — the job skips Statements that have already had money move against them.


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