Date and time when this entity was created
Date and time when this entity was last updated
If true, allows querying all rows without pagination limits via API
Controls whether this entity participates in server-side and client-side caching at all. When false (default for non-__mj entities), the entire cache code path is short-circuited: no PreRunView cache check, no auto-cache storage, no HandleBaseEntityEvent fingerprint scan, no client-side IndexedDB cache. Zero overhead on hot save/query paths.
Global flag controlling whether records can be created via API
Global flag controlling whether records can be deleted via API
When false (default), child types are disjoint — a record can only be one child type at a time. When true, a record can simultaneously exist as multiple child types (e.g., a Person can be both a Member and a Volunteer). This flag is set on the parent entity and controls whether its children are exclusive.
Whether records in this entity can be merged together
Global flag controlling whether records can be updated via API
Whether users can search this entity through the search API
Whether to audit when users access records from this entity
Whether to audit when views are run against this entity
When true (default), CodeGen can automatically set SupportsGeoCoding based on LLM analysis of entity fields. Set to false to lock the value.
The underlying database table name this entity maps to
The database view used as a "wrapper" for accessing this entity's data
Whether the base view is generated by CodeGen (true) or manually created (false)
Case-stable canonical schema name, sourced from the app manifest (mj-app.json schema.name) and persisted on SchemaInfo. When non-null it is used in place of SchemaName to derive the schema prefix for the entity ClassName/CodeName and GraphQL type name, so PostgreSQL installs (whose physical SchemaName is folded to lowercase) still produce PascalCase prefixes matching the published, hand-cased entity packages. NULL means "no override" -> the prefix falls back to SchemaName (every existing install, the core __mj schema, and SQL Server).
Whether to automatically delete related records when a parent is deleted
CodeName is a unique name that can be used for various programatic purposes, singular version of the entity name but modified from entity name in some cases to remove whitespace and prefix with _ in the event that the entity name begins with a number or other non-alpha character
If true, uses a custom resolver for GraphQL operations instead of standard CRUD
Type of delete operation: Hard (physical delete) or Soft (mark as deleted)
Detailed description of the entity's purpose and contents
Optional display name for the entity. If not provided, the entity Name will be used for display purposes.
Import statement for the entity's TypeScript subclass
Name of the TypeScript subclass for this entity if custom behavior is needed
If set, this entity is backed by an external data source (Snowflake, MongoDB, external SQL/PostgreSQL/MySQL, ...) and is read-only. Reads are proxied live through the registered ExternalDataSourceReadRouter. Null = backed by the MJ database.
Remote object name (table/view/collection) on the external system that backs this entity. Resolved against the data source defaults when unqualified. Only meaningful when ExternalDataSourceID is set.
Name of the SQL Server full-text catalog used for searching
Whether the full-text catalog is generated by CodeGen
Name of the full-text index on this entity
Whether the full-text index is generated by CodeGen
Whether full-text search is enabled for this entity
Name of the function used for full-text searching
Whether the full-text search function is generated by CodeGen
CSS class or icon identifier for displaying this entity in the UI
Unique identifier for the entity
Whether this entity is available through the GraphQL API
Unique name of the entity used throughout the system
Optional suffix appended to entity names for display purposes
Reserved for future use - parent entity for hierarchical relationships
Field name that contains the preferred communication method (email, phone, etc.)
Default display type for relationships: Search (type-ahead) or Dropdown
Database schema that contains this entity's table and view
Name of the stored procedure for creating records
Whether the create stored procedure is generated by CodeGen
Name of the stored procedure for deleting records
Whether the delete stored procedure is generated by CodeGen
Name of the stored procedure used for matching/duplicate detection
Name of the stored procedure for updating records
Whether the update stored procedure is generated by CodeGen
When true, this entity supports geocoding — CodeGen generates geo-aware subclass code, adds __mj_Latitude/__mj_Longitude virtual fields to the base view, and the UI shows a map view toggle. Auto-set by CodeGen when LLM detects geo-capable fields.
Whether to track all changes to records in the RecordChange table
When true (default), the server-side RunView cache will store and return cached results for this entity, trusting that all mutations flow through BaseEntity.Save() which fires cache invalidation events. Set to false for entities whose rows are created as side-effects of other operations via raw SQL (e.g., Record Changes created by spCreateRecordChange_Internal), since those inserts bypass BaseEntity and never trigger cache invalidation.
Whether the user form for this entity is generated by CodeGen
Maximum number of rows to return in user views to prevent performance issues
If true, this is a virtual entity not backed by a physical database table
Returns all fields from all parent entities in the IS-A chain, excluding primary keys, virtual fields, and timestamp fields (_mj prefixed). These represent the inherited fields that should be available on child entities.
The BaseTable but with spaces inbetween capital letters
Returns all child entities that have their ParentID set to this entity's ID. These represent IS-A type specializations of this entity. Example: For "Products" entity, might return [Meetings, Publications].
When AllowMultipleSubtypes is true on this entity, multiple children can
coexist for the same parent record (overlapping subtypes). When false (default),
only one child type is allowed per parent record (disjoint subtypes).
Returns an array of all fields whose TypeScript type is Date. Cached — used per query by the data providers' row post-processing to convert datetime values; recomputing the scan (and the per-field TSType classification) on every query is wasteful.
Array of date/datetime fields
Returns the DisplayName if it exists, otherwise returns the Name.
Returns an array of all fields that are configured for encryption. These fields will be automatically encrypted at rest and decrypted on load.
Array of encrypted fields
Gets the parsed FieldCategoryInfo map for this entity, keyed by category name. Auto-populated from the 'FieldCategoryInfo' EntitySetting (with legacy 'FieldCategoryIcons' fallback) during EntityInfo construction. Returns null if no category info is configured.
Gets all fields for this entity with their complete metadata.
Array of all entity fields
Returns the primary key field for the entity. For entities with a composite primary key, use the PrimaryKeys property which returns all. In the case of a composite primary key, the PrimaryKey property will return the first field in the sequence of the primary key fields.
Returns an array of all fields that are foreign keys to other entities.
Array of foreign key fields
Returns true if ANY field on this entity is Deprecated or Disabled (i.e. not Active).
Computed once on first access and cached for the lifetime of this EntityInfo. The value is a property of the entity definition (shared across every record instance), so the common case — an entity whose fields are all Active — is a single cached boolean.
This is the fast-path gate for active-status enforcement in BaseEntity.Get/Set/SetMany: when it is false those paths skip the per-field status lookup entirely, keeping hot read/write loops free of any deprecation-check overhead.
Convenience alias: returns true when this entity is a parent type that allows
overlapping (non-disjoint) subtypes. Equivalent to checking both
IsParentType and AllowMultipleSubtypes.
Returns true if this entity is a child type in an IS-A relationship (has a parent entity).
Returns true if this entity is a parent type in an IS-A relationship (has child entities).
Returns the EntityField object for the Field that has IsNameField set to true. If multiple fields have IsNameField on, the function will return the first field (by sequence) that matches. If no fields match, if there is a field called "Name", that is returned. If there is no field called "Name", null is returned.
Gets the organic keys defined on this entity. Organic keys enable cross-entity relationships based on shared business data (email, phone, SSN, etc.) rather than foreign key references. Only active organic keys are included.
Array of organic key definitions with their related entities
Walks the IS-A chain upward from this entity to the root, returning all parent entities. Does NOT include this entity itself. Example: For Webinars (IS-A Meetings IS-A Products), returns [Meetings, Products]. Results are cached after first computation for performance.
Returns a cached Set of field names that belong to parent entities in the IS-A chain, including the shared primary key(s). Used for efficient field routing in BaseEntity.Set/Get/SetMany/Hydrate operations. The Set enables O(1) lookup to determine if a field should be routed to the parent entity.
Note: AllParentFields excludes PKs (they aren't "inherited data" fields), but the routing set must include them so that SetMany and Hydrate can forward the shared IS-A primary key to parent entities.
Returns the parent EntityInfo for IS-A type inheritance, or null if this entity has no parent type. Uses the existing ParentID column on the Entity table. Example: For "Meetings" entity with ParentID pointing to "Products", returns the Products EntityInfo.
Gets the security permissions for this entity by role.
Array of permission settings
Returns an array of all fields that are part of the primary key for the entity. If the entity has a single primary key, the array will have a single element.
Gets all relationships where other entities reference this entity.
Array of entity relationships
Gets custom configuration settings for this entity.
Array of entity-specific settings
Returns an array of all fields that have unique constraints on them.
Array of fields with unique constraints
StaticCreatedReturns the name of the special reserved field that is used to store the CreatedAt timestamp across all of MJ. This is only used when an entity has TrackRecordChanges turned on
StaticDeletedReturns the name of the special reserved field that is used to store the DeletedAt timestamp across all of MJ. This is only used when an entity has DeleteType=Soft
StaticUpdatedReturns the name of the special reserved field that is used to store the UpdatedAt timestamp across all of MJ. This is only used when an entity has TrackRecordChanges turned on
ProtectedcopyCopies initialization data from a plain object to the class instance. Only copies properties that already exist on the class to prevent creating new fields. Special handling for DefaultValue fields to extract actual values from SQL Server syntax.
The initialization data object
O(1) case-insensitive field lookup by name. Use this instead of Fields.find(f => f.Name === name)
on hot paths — it builds a lowercased+trimmed Map once (lazily) and reuses it.
NOTE: this is a field-within-entity index, distinct from the entity-level "Map-backed entity lookups" that were evaluated and skipped (~500 entities, negligible). Here a single entity can be read field-by-field in tight loops, so the index is worthwhile.
field name (matched case-insensitively, whitespace-trimmed)
the matching EntityFieldInfo, or undefined if not found
Returns the Permissions for this entity for a given user, based on the roles the user is part of.
Allow rows are OR-aggregated across all of the user's matching roles; any single
Allow on an action yields permission for that action. Deny rows from any matching
role then subtract from the aggregated Allow set — so a Deny on CanDelete
overrides a Delete grant that the user otherwise has from another role. This lets
administrators carve out specific role exclusions without restructuring the Allow
hierarchy. Rows with a missing/unknown Type default to Allow for backwards
compatibility with data written before the Type column existed (Phase 2b).
Returns RLS security info attributes for a given user and permission type
Generates a where clause for SQL filtering for a given entity for a given user and permission type. If there is no RLS for a given entity or the user is exempt from RLS for the entity, a blank string is returned.
Default JSON serialization for BaseInfo subclasses.
Emits all non-underscored direct field declarations. For _-prefixed private backing fields
(the MJ pattern for collection storage — e.g. _Fields, _RelatedEntities, _OrganicKeys),
emits the value of the corresponding same-named public getter instead. Purely computed getters
without a backing field (display-name formatters, derived flags) are intentionally skipped —
they can throw when source fields are null and don't belong on the wire anyway.
Nested BaseInfo instances and arrays of them unwrap automatically via JSON.stringify's native toJSON() protocol.
Subclasses may override to emit a filtered subset or custom shape (see EntityFieldValueInfo).
Determines if a given user, for a given permission type, is exempt from RowLevelSecurity or not
StaticAssertThis static factory method is used to check to see if the entity in question is active or not If it is not active, it will throw an exception or log a warning depending on the status of the entity being either Deprecated or Disabled.
the EntityInfo object to check the status of
the name of the caller that is calling this method, used for logging purposes such as BaseEntity::constructor as an example.
StaticBuildReturns a RunViewParams object configured to query the related entity matched via an organic key. Supports both direct field matching and transitive matching via SQL views/tables.
The current record whose organic key values will be used for matching
The organic key related entity configuration
The parent organic key definition
Optionalfilter: stringOptional additional SQL filter to AND with the organic key filter
OptionalmaxRecords: numberOptional max rows to return
RunViewParams ready to pass to RunView
StaticBuildBuilds a simple javascript object that will pre-populate a new record in the related entity with values that link back to the specified record. This is useful, for example, when creating a new contact from an account, we want to pre-populate the account ID in the new contact record
StaticBuildReturns a RunViewParams object that is setup to filter the related entity for the provided record
Optionalfilter: stringOptionalmaxRecords: number
Catalog of all entities across all schemas. Contains comprehensive metadata about each entity including its database mappings, security settings, and UI preferences.