# Company IM + TKO Investor Fields (User Doc)

## Overview
On the **Company edit** screen, some dynamic fields behave like “linked fields”:

- `Im1` … `Im9` are user contacts.
- `tko_investor1` … `tko_investorN` are EDM investors/funds.

The UI helps you pick values from the database via autocomplete / remote dropdowns.

## IM fields (`Im1` … `Im9`)
### What you type
- Type any few characters (minimum **2** characters).
- Suggestions are fetched from the `users` table by:
  - email
  - first name
  - last name

### What you see in the dropdown
- Each suggestion shows: **first name + last name + email**

### What gets saved
- When you select a suggestion, the **saved value is the email only**.

### If you don’t select
- You can keep typing; the final typed value is still what will be validated/submitted.

## TKO investor fields (`tko_investor1` … `tko_investorN`)
### What you type
- Use the remote dropdown.
- Type any few characters (minimum **2** characters).

### What you see in the dropdown
- Each suggestion shows:
  - `short_name`
  - and the underlying `edm_id` (small text)

### What gets saved
- When you select, the **saved value is `edm_id`**.

## Company profile (read-only display)
On the **Company profile** (read-only):

- For `Im1` … `Im9`:
  - if the stored email matches a `users.email`, it displays **first name + last name**
  - otherwise it displays the raw value with a yellow background
- For `tko_investor*`:
  - if the stored `edm_id` matches `edm_investors.edm_id`, it displays `short_name`
  - otherwise it displays the raw value with a yellow background

## Textarea usage (edit rule)
When editing a company:

- If `company.data->tko_investor2` is **not empty**
- then **all textarea dynamic fields whose name ends with `2`** become **read-only** (not editable).

This is enforced server-side and affects the edit form only.

