# Add an object dependency (constraint and calculated characteristic)

> On a configurable item, add a constraint that blocks a disallowed combination and a procedure that calculates the value of a characteristic with a formula.

URL: https://erpdocs.corexlogic.com/en/uretim/islemler/nesne-bagimliligi-ekleme

- **Type:** Task
- **Module:** Manufacturing
- **Menu path:** Ana Veriler › Ürünler › Ürün Ana Verileri › ürün detayı › Yapılandırma › Nesne Bağımlılıkları (Master Data › Items › Item Master Data › item detail › Configuration › Object Dependencies)
- **Screen route:** `/erp/catalog/products/{id}?tab=yapilandirma`
- **Required permission:** `erp-catalog-items.edit`
- **Prerequisites:**
  - The item is configurable; the characteristic that will be the procedure's target is a configuration characteristic of the card (if not, use **Yeni özellik oluştur** (Create new characteristic) in the window).

Object dependencies are the configuration rules of the item: which combination cannot be sold (constraint), which
value is calculated (procedure), and which combinations are allowed in a table (table constraint). Language:
[Expression language](https://erpdocs.corexlogic.com/en/uretim/kosullar#ifade-dili).

## Steps

1. On the item's **Yapılandırma** (Configuration) tab, scroll down to the **Nesne Bağımlılıkları** (Object Dependencies) section and click **Kural Ekle** (Add Rule).
   <!-- action: click · target: "Kural Ekle" -->

   ![Add Rule — compute value, set a limit, select from table](https://erpdocs.corexlogic.com/en/en/img/screens/uretim/kural-ekle.png)
   1. Procedure — computes a characteristic
   2. Constraint — blocks a forbidden combination
   3. Table constraint — variant table
   4. Formula — the language of the conditions page

2. For a constraint, select **Sınır koy** (Restrict). In the **Koşul** (Condition) field, enter the expression that returns Evet (Yes) when the combination is valid; an "if A then B" rule has the form `DEĞİL A VEYA B`.
   <!-- action: fill · target: "Koşul" · value: "BANT_TIPI <> 'PU' VEYA BOY <= 20" -->
3. In the **Kullanıcıya ileti** (Message to user) field, enter the sentence to be shown in sales. In the **Dene** (Try) panel on the right, enter sample values and see the result.
   <!-- action: fill · target: "Kullanıcıya ileti" · value: "PU gıda bandı en çok 20 m boyda üretilir." -->
4. For a calculated characteristic, select **Değer hesapla** (Calculate value); select the target from the **Hesaplanacak özellik** (Characteristic to calculate) list, **Formül (gelişmiş)** (Formula, advanced) in **Nasıl hesaplansın** (How to calculate), **Her zaman hesapla** (Always calculate) or **Girilmezse hesapla** (Calculate if not entered) in **Ne zaman** (When), and enter the expression in the **Formül** (Formula) field.
   <!-- action: fill · target: "Formül" · value: "TAVAN(BOY / 1.5) + 1" -->
5. Leave **Etkin (pasif kural uygulanmaz)** (Active — an inactive rule is not applied) checked; click **Ekle** (Add).
   <!-- action: click · target: "Ekle" · expect: "The rule is added to the Nesne Bağımlılıkları (Object Dependencies) list" -->

**Result:** The rules are applied in list order when the sales line is saved: a procedure writes the value, a constraint checks the combination. A calculated characteristic can be read in BOM and routing rules; see the result with [Configure and Test](https://erpdocs.corexlogic.com/en/uretim/islemler/yapilandirarak-deneme).

## What you need to know

- A constraint is checked only when its result is **known**; if a characteristic it reads is empty, it passes.
- If the message is empty, sales shows `Konfigürasyon kısıtı sağlanmıyor: <ifade>` (Configuration constraint not
  satisfied: `<expression>`). In the demo example with a PU belt and 24 m:
  `PU gıda bandı en çok 20 m boyda üretilir.` (A PU food belt is produced up to 20 m in length.)
- The user cannot change a value written with **Her zaman hesapla** (Always calculate):
  `'Ayak Çifti Sayısı' değeri kuraldan hesaplanır (8); farklı değer verilemez.` (The value of 'Number of Leg Pairs' is
  calculated by the rule (8); a different value cannot be entered.)
- A procedure that writes a fractional result to an integer target is rejected
  (`… tam sayı — prosedür … hesapladı (YUVARLA kullanın).` — … is an integer — the procedure calculated … (use
  YUVARLA).). A result written to a target with options must be one of the target's option codes.
- A date characteristic cannot be a procedure target.
- A rule that breaks an existing variant is not saved; a card can have at most 50 rules.
- Constraints and procedures can query a variant table with `TABLO` / `TABLODEGER`; a BOM line rule cannot query it —
  write the value from the table to a characteristic with a procedure and read it on the line.

## Related

- [Conditions and formulas — object dependencies](https://erpdocs.corexlogic.com/en/uretim/kosullar#nesne-bagimliliklari)
- [Configurable items](https://erpdocs.corexlogic.com/en/uretim/ekranlar/yapilandirilabilir-urunler)
