# Configuring FX Sales

This page describes how to configure FX Sales.

For information on individual configuration options, see [FX Sales Configuration](st-fx-sales-configuration.md).

## Configuring FX Sales at deployment 

From FX Sales version 2.30, you can use an external JSON file to override [application configuration](st-fx-sales-configuration.md) in the FX Sales WAR file. This makes it easier to change configuration in testing environments, facilitating the testing of configuration and features not yet enabled in production.

This method is suitable for overriding string, integer, and boolean configuration values (and arrays thereof). To override a configuration option that takes a JavaScript object or function, see [Configuring FX Sales in development](#configuring-fx-sales-in-development) below.

Follow the steps below to override configuration in an existing FX Sales deployment on Apache Tomcat 9:

1. In the [application context](https://tomcat.apache.org/tomcat-9.0-doc/config/context.html) for FX Sales, set the JNDI environment variable `CONFIG_FILE` to an absolute or relative path to the external configuration file:

   **&lt;tomcat_root>/conf/Catalina/localhost/&lt;variant>salestrader.xml**

   ```xml
   <Environment name="CONFIG_FILE"
     value="../../conf/fxsales/ExternalAppConfig.json"
     type="java.lang.String" override="false" />
   ```

   For more information on setting JNDI environment entries for FX Sales, see [FX Sales JNDI configuration](st-jndi-configuration.md) and [Deploying FX Sales](deploying-fx-sales.md).
2. Create the external configuration file with the content below:

   **&lt;tomcat_root>/conf/fxsales/ExternalAppConfig.json**

   ```json
   {

   }
   ```
3. To override a [configuration option](st-fx-sales-configuration.md), add a property of the same name to the JSON object.  For example, to set the [`BLOCK_TRADING.ENABLED`](st-fx-sales-configuration.md#block-trading-enabled) configuration option to `true`, add the following property to the JSON object:

   **&lt;tomcat_root>/conf/fxsales/ExternalAppConfig.json**

   ```json
   {
     "BLOCK_TRADING.ENABLED": true
   }
   ```
4. Restart the FX Sales web application

## Configuring FX Sales in development

This method requires the source code distribution of FX Sales. The benefits of overriding the configuration in the source code are that any changes are tracked, and any new configuration set is guaranteed to be present at deployment. 

To override a configuration option, assign an identically named property to the `extendedOptions` object in the configuration file for your variant: `apps/salestrader/src/customers/<variant>/<variant>SalesAppConfig.js`.

**❗ IMPORTANT**\
Do not edit the file `apps/salestrader/src/salestrader-default-aspect/AppConfig.js`, which contains Caplin-set application defaults. Instead, edit the configuration file for your variant: `apps/salestrader/src/customers/<variant>/<variant>SalesAppConfig.js`.

In the example below, `<variant>SalesAppConfig.js` has been used to enable the Block Trades feature and adjust the maximum number of rows that may be uploaded to Block Trades in a spreadsheet:

**Example use of &lt;variant>SalesAppConfig.js**

```js
import AppConfig from "../../salestrader-default-aspect/AppConfig";
const extendedOptions = {
  "BLOCK_TRADING.ENABLED": true,
  "BLOCK_TRADING.UPLOAD_ROW_LIMIT": 80
};
export default Object.assign({}, AppConfig, extendedOptions);
```

---

**See also:**

* [FX Sales Configuration](st-fx-sales-configuration.md)
