Entities & Attributes
Overview
Entities and Attributes form the core of your data model in Opadeez. Entities represent the main business objects (like Customer, Project, or Invoice), while Attributes define the specific properties and fields that describe each entity. Together, they create the database structure that stores and organizes your application's data.
Data Dictionary interface showing Entities/Attributes configuration
Entity Properties
Entity Configuration
Each entity in your system has several key properties that control its behavior and database implementation:
Entity Name
- Purpose: Unique identifier for the entity
- Database Usage: This name becomes the database table name
- Naming Rules: Use singular nouns without spaces (e.g., "Customer", not "Customers")
- Best Practice: Choose descriptive names that clearly represent the business concept
Has Lock
- Purpose: Enable record locking to prevent concurrent access issues
- When to Use: Set for entities that multiple users might edit simultaneously
- Best Practice: Apply locks at top-level entities to avoid multiple users accessing the same record
Is Temporary
- Purpose: Mark entities for temporary use during workflows
- Usage: Temporary tables for calculations or temporary storage within workflow scope
- Database Impact: Not stored permanently in the database
- Use Cases: Intermediate calculations, data transformation, temporary result sets
Connection (Optional)
- Purpose: Specify which database connection to use for this entity
- Multi-Database Support: Opadeez supports storing different tables in different databases
- Setup Required: Create additional Connections first (see Data Dictionary Connections section)
- Flexibility: Each entity can use a different database connection if needed
Example: A "Customer" entity might use the main application database, while a "Report" entity could connect to a separate reporting database.
Attribute Properties
Basic Attribute Configuration
Attribute Name
- Purpose: Technical identifier for the attribute
- Naming Rules: No spaces, use camelCase (e.g., "CompanyName", "RelationshipDate")
- Database Usage: Used as the database column name unless DB Field name is specified
- Best Practice: Use descriptive names that indicate the data purpose
Label
- Purpose: User-friendly display name for the attribute
- Usage: Shown on pages and forms when the attribute is displayed
- Default Behavior: If not provided, the "Attribute name" is used as the label
- Best Practice: Use clear, readable labels with proper spacing and capitalization
Example: Attribute name "CompanyName" with label "Company Name" - the technical name has no spaces, but the user sees "Company Name" on forms.
Type
- Purpose: Define the data type and storage format
- Available Types: Boolean, String, Integer, Decimal, Date, Date time, Time, File
- Additional Settings: Depending on type, additional options become available (Length, Signed, Precision, etc.)
- Validation: Type determines what data can be stored and how it's validated
DB Field Name (Optional)
- Purpose: Override the database column name
- Default Behavior: If not provided, the attribute name is used as the table field name
- Use Cases: Integration with existing databases, legacy system compatibility
- Best Practice: Only use when necessary for database compatibility
Advanced Attribute Features
Value List
- Purpose: Create dropdown selections for standardized data entry
- Reference: Links to a "Value List" definition (see Value Lists)
- Display: Attribute appears as a drop-down list or auto-complete search input
- Data Consistency: Ensures users can only select predefined values
Value List Dependency
- Purpose: Create cascading dropdown lists based on other field values
- Setup: Select the field that holds the dependency value for filtering
- Requirement: Value List must have "Dependency Value" defined for its entries
- Use Case: Country/State relationships, Category/Subcategory selections
Is Temporary
- Purpose: Mark attributes for temporary calculations
- Usage: Fields used for intermediate calculations within workflows
- Database Impact: Not stored permanently in the database
- Performance: Reduces database storage and improves performance for calculation fields
Audit Trail
- Purpose: Track changes to attribute values over time
- Function: Value changes are saved in audit trail records
- Compliance: Essential for regulatory requirements and change tracking
- Best Practice: Enable for critical business data and sensitive information
Formula
- Purpose: Create computed fields with automatic calculations
- Behavior: Computed fields are read-only and cannot be manually edited
- Real-time Updates: Values update automatically when dependent fields change
- Script Helper: Use the gear icon to open the script helper window for syntax assistance
- Scripting Language: Formulas use the Opadeez Scripting Language for calculations and logic
Formula Example: Calculate age from date of birth:
Relationship Duration:
See the Scripting Language Reference for complete syntax and function documentation.
datediff(now(), DateOfBirth, "y")
Relationship Duration:
dateDiff(RelationshipDate, now(), "y")
See the Scripting Language Reference for complete syntax and function documentation.
Data Types and Configuration
String Type
- Length: Maximum number of characters (required)
- Use Cases: Names, descriptions, codes, addresses
- Value Lists: Can be associated with value lists for dropdown behavior
Integer Type
- Length: Number of digits (affects display width)
- Signed: Allow negative values
- Use Cases: Counts, IDs, years, quantities
Decimal Type
- Length: Number of digits for integer part
- Scale: Number of decimal places
- Use Cases: Monetary amounts, percentages, measurements
Date Type
- Format: Automatically handled by the system
- Functions: Can be used in date calculations and formulas
- Use Cases: Birth dates, transaction dates, deadlines
Boolean Type
- Display: Typically shown as checkboxes
- Values: True/False, Yes/No
- Use Cases: Flags, status indicators, preferences
Best Practices
Entity Design
- Normalization: Avoid data duplication by proper entity separation
- Naming: Use clear, singular nouns that represent business concepts
- Locking: Apply locks judiciously to prevent conflict update issues
- Temporary Entities: Use for complex calculations and data transformations
Attribute Configuration
- Data Types: Choose appropriate types for performance and storage efficiency
- Field Lengths: Set realistic but adequate limits to prevent data truncation
- Labels: Use user-friendly labels that differ from technical attribute names
- Formulas: Test calculated fields thoroughly with various data scenarios
Performance Considerations
- Temporary Fields: Use for calculations that don't need permanent storage
- Audit Trails: Enable selectively to balance compliance needs with performance
- Value Lists: Use for standardization and improved user experience
- Connections: Distribute entities across databases for optimal performance
Practical Examples
Customer Entity Example
- Entity Name: Customer
- Has Lock: True (multiple users might edit customer records)
- Key Attributes:
- CompanyName (String, Length: 50, Label: "Company Name")
- RelationshipDate (Date, Label: "Relationship Date")
- RelationshipDuration (Integer, Formula: dateDiff(RelationshipDate, now(), "y"))
- Status (String, Length: 1, Value List: CustomerStatus)
Project Entity Example
- Entity Name: Project
- Has Lock: True
- Key Attributes:
- Name (String, Length: 50, Label: "Project Name")
- Status (String, Length: 1, Value List: ProjectStatus)
- StartDate (Date, Label: "Start Date")
- DaysActive (Integer, Formula: dateDiff(StartDate, now(), "d"))
Getting Started
Ready to create your entities and attributes? Follow these resources:
- Your First Application - Part 3: Step-by-step tutorial for creating entities and attributes
- Data Dictionary Overview: Understanding the complete data model structure
Related Topics
- Value Lists: Create dropdown options for attributes
- Links: Define relationships between entities
- DataSets: Create navigable views of your entities
- Opadeez Scripting Language: Complete reference for writing formulas and calculations
- Basic Concepts: Understand fundamental Opadeez terminology
Pro Tip: Start with your core business entities and their essential attributes. You can always add more entities and attributes as your application grows and requirements evolve.