Custom Objects & Fields

Build custom data models without code — Salesforce-style object builder

Overview

OptiCRM's custom object builder lets you create new data models (entities) without writing code. This follows the Salesforce/Oracle enterprise CRM pattern where the database schema is extensible at runtime.

Creating a Custom Object

Navigate to Database > Object Manager and click New Object:

  1. Name — Display name (e.g., "Course")
  2. API Name — System name, auto-generated (e.g., "Course")
  3. Plural Name — For list views (e.g., "Courses")
  4. Icon — Choose from 100+ Lucide icons
  5. Color — Accent color for the entity
  6. Description — What this object represents

The object appears in the sidebar automatically and gets its own list/detail/form pages at /o/<apiName>.

Field Types

OptiCRM supports 23 field types:

TypeDescriptionExample
TextSingle-line textName, Title
Text AreaMulti-line textDescription, Notes
NumberInteger or decimalQuantity, Score
CurrencyMoney value (stored as paise)Fee Amount
PercentPercentage valueDiscount Rate
DateDate onlyDue Date
DateTimeDate and timeEvent Start
BooleanTrue/False toggleIs Active
SelectSingle-select dropdownStatus, Priority
Multi-SelectMulti-select checkboxesTags, Skills
EmailEmail addressContact Email
PhonePhone numberMobile
URLWeb linkWebsite
LookupReference to another objectAssigned To
Master-DetailRequired parent referenceInvoice → Student
FormulaComputed field (read-only)Outstanding = Total - Paid
RollupAggregate from childrenTotal Invoices
Auto-NumberAuto-incrementing codeREF-2026-00001
GeolocationLatitude/LongitudeCampus Location
ImageImage uploadPhoto
FileFile attachmentDocument
Rich TextHTML contentArticle Body
JSONStructured dataConfiguration

Relationships

TypeDescription
Has OneOne-to-one (e.g., Student has one Health Profile)
Has ManyOne-to-many (e.g., Student has many Invoices)
Belongs ToInverse of Has Many
Many-to-ManyJunction table relationship
Master-DetailRequired parent with cascade delete and rollup support

Formula Engine

Formula fields support 30+ functions:

  • Logic: IF, AND, OR, NOT
  • Math: ROUND, CEIL, FLOOR, ABS, MOD, POWER, SQRT
  • Text: LEN, LEFT, RIGHT, MID, UPPER, LOWER, TRIM, CONTAINS, CONCATENATE
  • Date: TODAY, NOW, YEAR, MONTH, DAY, DATEVALUE, DATEDIF

Example: IF(totalAmount - paidAmount > 0, "Outstanding", "Paid")

Validation Rules

Define formula-based validation rules:

  • Condition formula (when TRUE, validation fails)
  • Error message shown to user
  • Active/inactive toggle

Hooks (Before/After Save)

Define automated actions on record create/update:

  • Field Updates — Auto-set field values
  • Send Email — Trigger email on save
  • Send Notification — Create in-app notification
  • Before-save hooks can block saves (validation)
  • After-save hooks run post-commit

Global Picklists

Shared dropdown value sets used across multiple objects:

  • Create at Database > Global Picklists
  • Reuse in any Select field on any object
  • Central management — change once, applies everywhere