Many data models have a well-known primary key which can be defined at development time. However, there are some models where pre-defining the primary key is too restrictive to meet the business requirement. One example is the names of financial accounts in a general ledger. By convention in the accounting industry, these names are displayed as a single field, but logically divided into several segments. Each segment has specific rules and interdependencies depending on the company.

For example: 1099-105

  • 4-digit : 1 digit for "type" (1* Asset, 2* Liability, 3* Equity, 4* Sales/Income, etc.) and 3 digits for "acct number"
  • 3-digit : "department" (Dev, QA, HR, etc)

The DynaField field type allows for a runtime-defined "dynamic field" as a key or non-key field on a model. The "schema" (such as the two-attribute schema defined above) is stored as meta-data in the database.