Reusable logic
Reusable logic gives Company Schema rules that more than one field or caller can use. Choose the rule by what it returns.
Ownership
Reusable logic separates shared definitions from the Records that use them. Value Types define allowed values. Derived Attributes define computed facts. Saved Queries retain selection rules. Functions define callable logic. A Context Projection shapes context for a consumer. A change to a shared rule deserves review wherever fields, selections, or callers depend on it.
| Object | Console location | Reader question |
|---|---|---|
| Value Types | /schema/types | Which rule should these fields share? |
| Derived Attributes | /schema/derived-attributes | Which fact should be computed? |
| Saved Queries | /schema/saved-queries | Which selection should callers reuse? |
| Functions | /schema/functions | Which logic should callers invoke? |
| Context Projections | /schema/context-projections | Which context should a consumer receive? |
Lifecycle
Reusable logic keeps some rules fixed and uses others on live data. A Value Type publishes a fixed revision. A field pins that exact revision. A later revision does not rewrite the field's binding. Retired revisions still serve bound fields and history. A Saved Query reads current data each time you call it. Its result can change as Records or access rules change, even when the saved rule stays the same.
Boundaries
Reusable logic separates a selection from a collection. A Saved Query describes which Records match. A Static List retains chosen members. Lists and membership explains the different work targets. A Derived Attribute's computation also differs from an Action's effect. Actions and writeback owns the model for changing values and confirming an external write.
Failures
Reusable logic can fail before it yields a value or selection. A Value Type publish refuses an invalid rule or a stale expected revision. A breaking revision needs its impact acknowledged. A Saved Query can return an invalid, stale, too-broad, or denied result. A refusal to read a selection does not mean that no Records match.
Recovery
Reusable logic should be checked at the definition that failed. For a Value Type, read the active revision and the fields that pin it before revising the rule. For a Saved Query, use savedQueries.preview to inspect the selection before retaining it. savedQueries.create owns the save contract. Narrow an over-broad selection, repair stale field references, or resolve the stated access refusal before using its result as work.
Related
- Schema model explains how a field binds reusable rules and Interface roles.
- Actions and writeback helps builders choose an effect after selecting the Records it should act on.
- API gives callers HTTP setup for the Saved Query operations linked here.