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

# End-to-end walkthrough: How custom attributes work

> This example-based document shows how to add a required customer attribute and follow its value from a customer to new contracts and invoices.

## Story: sales region as a custom attribute for customer records

Your company sells access to a messaging API. The finance team reports revenue by sales region. A customer record has no field for the sales region. A [custom attribute](https://zenskar.com/docs/20260301/zenskar-modules/settings/custom-attributes/concepts.md#custom-attributes-details-that-you-add-to-records) adds that field. New [contracts](https://zenskar.com/docs/20260301/zenskar-modules/contracts/glossary.md#contract) also need the sales region, without your billing team entering it again on each one.

Your billing team adds the custom attribute `Sales region`. It sets the value of `Sales region` on the customer Acme Corp. It checks that value on a new contract. It then follows that value over time.

The walkthrough puts the following concepts into practice: [custom attribute](https://zenskar.com/docs/20260301/zenskar-modules/settings/custom-attributes/concepts.md#custom-attributes-details-that-you-add-to-records), [custom attribute key](https://zenskar.com/docs/20260301/zenskar-modules/settings/custom-attributes/concepts.md#custom-attribute-keys-how-a-custom-attribute-is-identified), [custom attribute type](https://zenskar.com/docs/20260301/zenskar-modules/settings/custom-attributes/concepts.md#custom-attribute-types-what-a-value-can-hold), [options](https://zenskar.com/docs/20260301/zenskar-modules/settings/custom-attributes/concepts.md#options-what-a-list-value-can-be), [default values](https://zenskar.com/docs/20260301/zenskar-modules/settings/custom-attributes/concepts.md#default-values-what-a-new-record-starts-with), [required values](https://zenskar.com/docs/20260301/zenskar-modules/settings/custom-attributes/concepts.md#required-values-what-a-record-must-have), [scope](https://zenskar.com/docs/20260301/zenskar-modules/settings/custom-attributes/concepts.md#scope-which-records-a-custom-attribute-applies-to), and [copied value](https://zenskar.com/docs/20260301/zenskar-modules/settings/custom-attributes/concepts.md#copied-values-how-new-records-receive-values).

The custom attribute uses these settings:

| Setting | Value |
| - | - |
| **Name** | `Sales region` |
| **Key** | `sales_region` |
| **Type** | **Dropdown** |
| **Options** | `EMEA`, `APAC`, `Americas` |
| **Default value** | `EMEA` |
| **Applies to** | **All business entities** |
| **Required** | `Selected` |
| **Copy to new contracts, invoices and journal entries** | `Selected` |

The company and the customer are fictional.

### Prerequisites

* You need a role with these permissions: **Can Read Organisation Config**, **Can Create Organisation Config**, **Can Read Customer**, **Can Update Customer**, **Can Read Contract**, and **Can Create Contract**.
* The customer Acme Corp must exist.

### Add the customer attribute

Your billing team adds `Sales region` as a [customer attribute](https://zenskar.com/docs/20260301/zenskar-modules/settings/glossary.md#custom-attribute). A sales region describes the customer.

> [!CAUTION]
>
> The custom attribute key and type cannot change after you add it. Check them before you click **Add attribute**.

1. Go to **Settings** > **Custom Attributes**. The **Customers** screen shows the customer attributes.

2. Click **Add customer attribute**. The **Add customer attribute** screen opens.

3. In **Name**, enter `Sales region`. The dashboard shows the generated key, `sales_region`.

   Imports, exports, and templates identify the custom attribute by this [custom attribute key](https://zenskar.com/docs/20260301/zenskar-modules/settings/custom-attributes/concepts.md#custom-attribute-keys-how-a-custom-attribute-is-identified).

4. In **Type**, select **Dropdown**.

   The finance team groups revenue by sales region. Every customer must therefore use the same few region names. Two [custom attribute types](https://zenskar.com/docs/20260301/zenskar-modules/settings/custom-attributes/concepts.md#custom-attribute-types-what-a-value-can-hold) can hold a region name. They differ in what your billing team can enter.

   | Custom attribute type | What your billing team can enter | What the finance team sees |
   | - | - | - |
   | Dropdown | One of `EMEA`, `APAC`, or `Americas`. | Three regions. |
   | Text | Any text, such as `EMEA`, `Europe`, or `emea`. | One region for each spelling. |

   Your billing team needs the dropdown custom attribute type.

5. In **Options**, enter `EMEA`, and press Enter. Do the same for `APAC` and `Americas`.

6. In **Default value**, select `EMEA`.

   Most customers of your company are in the EMEA sales region. A new customer gets [this default value](https://zenskar.com/docs/20260301/zenskar-modules/settings/custom-attributes/concepts.md#default-values-what-a-new-record-starts-with) when no other value is set.

7. In **Applies to**, keep **All business entities**.

   Every customer needs a sales region, whatever its [business entity](https://zenskar.com/docs/20260301/zenskar-modules/settings/custom-attributes/concepts.md#scope-which-records-a-custom-attribute-applies-to). With one business entity selected, only the customers of that business entity would have the custom attribute.

8. Select **Required**.

   The revenue report is complete only if every customer has a sales region. `Sales region` is therefore a [required custom attribute](https://zenskar.com/docs/20260301/zenskar-modules/settings/custom-attributes/concepts.md#required-values-what-a-record-must-have). The rule also reaches customers that already exist and have no value. What each customer gets depends on the default value.

   | Default value | New customer with no region selected | Existing customer without a value, at its next save |
   | - | - | - |
   | `EMEA` | The customer gets `EMEA`. | The customer gets `EMEA`. |
   | None | Your billing team must select a region. | Your billing team must select a region before the save. |

   Your billing team keeps the default value. An existing customer outside EMEA gets `EMEA` at its next save, unless someone sets its region first. Acme Corp is one of those customers. The next section sets its region.

9. Select **Copy to new contracts, invoices and journal entries**.

   Your billing team does not want to enter the region again on each contract. This setting decides whether a new contract has `Sales region` at all.

   | Setting | New contract of a customer with `APAC` |
   | - | - |
   | Selected | The contract starts with `APAC`, as a [copied value](https://zenskar.com/docs/20260301/zenskar-modules/settings/custom-attributes/concepts.md#copied-values-how-new-records-receive-values). |
   | Not selected | The contract does not have `Sales region`. |

   Your billing team selects it.

10. Click **Add attribute**.

The dashboard confirms the addition. The list shows `Sales region` with **Required** and **Copies to new contracts** under **Rules**.

### Set the sales region of Acme Corp

Acme Corp is an existing customer in the APAC sales region. It has no value for `Sales region` yet. Your billing team sets that value before the next save of Acme Corp writes `EMEA`.

1. Go to **Customers**, and click Acme Corp. The customer screen opens.

2. Click **Edit**. The **Edit customer** screen opens.

3. Under **Custom attributes**, in **Sales region**, select `APAC`.

   `Sales region` is [required](https://zenskar.com/docs/20260301/zenskar-modules/settings/custom-attributes/concepts.md#required-values-what-a-record-must-have). While the field is empty, the dashboard shows **Left empty, this saves as** `EMEA` below it. The selection decides what the save writes.

   | Selection in **Sales region** | Value of Acme Corp after the save |
   | - | - |
   | `APAC` | `APAC` |
   | None | `EMEA`, the default value |

   Your billing team selects `APAC`.

4. Click **Save changes**.

The dashboard confirms the save. On the customer screen, **View** next to **Custom attributes** shows `APAC`.

### Check the copied value on a new contract

Your billing team checks that a new contract receives the value of `Sales region` from Acme Corp.

1. Go to **Contracts**.

2. Click **CREATE CONTRACT**. The **New contract** screen opens.

3. In **Customer**, select Acme Corp.

4. Under **Custom attributes**, find **Sales region**. It shows `APAC`, with **This value is from the customer** below it.

   This is a [copied value](https://zenskar.com/docs/20260301/zenskar-modules/settings/custom-attributes/concepts.md#copied-values-how-new-records-receive-values). It comes from Acme Corp. The default value, `EMEA`, applies only to customers.

   A contract can hold a different value from its customer. The dashboard shows where the value comes from.

   | Action in **Sales region** | Value on this contract | What the dashboard shows |
   | - | - | - |
   | Keep `APAC`. | `APAC` | **This value is from the customer** |
   | Select `EMEA`. | `EMEA` | **Edited for this contract**, with **Restore** |

   Acme Corp keeps `APAC` in both cases. Your billing team keeps `APAC`.

5. Click **Cancel**, and confirm that you want to discard the contract.

No contract is created.

### Follow the copied value over time

`Sales region` is now required on every customer. Your billing team follows Acme Corp through a series of changes. The [copied value](https://zenskar.com/docs/20260301/zenskar-modules/settings/custom-attributes/concepts.md#copied-values-how-new-records-receive-values) on each record depends on when that record is created.

| Event | Acme Corp | `Contract_1` | `Contract_2` | Invoice of `Contract_1` |
| - | - | - | - | - |
| 1. Your billing team creates `Contract_1`. | `APAC` | `APAC` (copied value) | | |
| 2. `Sales region` on Acme Corp changes to `Americas`. | `Americas` | `APAC` | | |
| 3. Your billing team creates `Contract_2`. | `Americas` | `APAC` | `Americas` (copied value) | |
| 4. Your billing team changes `Sales region` on `Contract_1` to `EMEA`. | `Americas` | `EMEA` | `Americas` | |
| 5. `Contract_1` creates an invoice. | `Americas` | `EMEA` | `Americas` | `EMEA` (copied value) |

After event 4, **View** next to **Custom attributes** on `Contract_1` no longer shows **This value is from the customer**. The dashboard does not show the custom attribute values of an invoice, so your billing team cannot check event 5 there.

See [Behavior: how copied values work](https://zenskar.com/docs/20260301/zenskar-modules/settings/custom-attributes/concepts.md#behavior-how-copied-values-work).

### Change the custom attribute later

Your billing team later changes `Sales region` itself. Neither change touches a value that a record already holds.

| Change | What happens |
| - | - |
| Your billing team clears **Copy to new contracts, invoices and journal entries**. | New contracts and invoices stop receiving the value. |
| Your billing team removes `Americas` from **Options**. | New contracts of Acme Corp and new invoices of `Contract_2` still receive `Americas`. Your billing team cannot select `Americas` as a new value on another record. |

### Summary: what your billing team did

Your billing team added `Sales region` as a required customer attribute that copies to new records. It set the value of `Sales region` on Acme Corp. It saw that value arrive on a new contract. Later changes on Acme Corp did not reach records that already existed. Those records stayed auditable.

See [Add a custom attribute](https://zenskar.com/docs/20260301/zenskar-modules/settings/custom-attributes/how-to-guides.md#add-a-custom-attribute).


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