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:
- Name — Display name (e.g., "Course")
- API Name — System name, auto-generated (e.g., "Course")
- Plural Name — For list views (e.g., "Courses")
- Icon — Choose from 100+ Lucide icons
- Color — Accent color for the entity
- 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:
| Type | Description | Example |
|---|---|---|
| Text | Single-line text | Name, Title |
| Text Area | Multi-line text | Description, Notes |
| Number | Integer or decimal | Quantity, Score |
| Currency | Money value (stored as paise) | Fee Amount |
| Percent | Percentage value | Discount Rate |
| Date | Date only | Due Date |
| DateTime | Date and time | Event Start |
| Boolean | True/False toggle | Is Active |
| Select | Single-select dropdown | Status, Priority |
| Multi-Select | Multi-select checkboxes | Tags, Skills |
| Email address | Contact Email | |
| Phone | Phone number | Mobile |
| URL | Web link | Website |
| Lookup | Reference to another object | Assigned To |
| Master-Detail | Required parent reference | Invoice → Student |
| Formula | Computed field (read-only) | Outstanding = Total - Paid |
| Rollup | Aggregate from children | Total Invoices |
| Auto-Number | Auto-incrementing code | REF-2026-00001 |
| Geolocation | Latitude/Longitude | Campus Location |
| Image | Image upload | Photo |
| File | File attachment | Document |
| Rich Text | HTML content | Article Body |
| JSON | Structured data | Configuration |
Relationships
| Type | Description |
|---|---|
| Has One | One-to-one (e.g., Student has one Health Profile) |
| Has Many | One-to-many (e.g., Student has many Invoices) |
| Belongs To | Inverse of Has Many |
| Many-to-Many | Junction table relationship |
| Master-Detail | Required 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