Table Properties Configuration
Earn 25 points (50 with Pro) in two steps
- ① Read through the lesson — each section gets a ✓ as you scroll through it.
- ② When every section has a ✓, tap Complete lesson.
0 of 10 read · keep scrolling
✦ See fewer ads and earn double points — 50 a lesson instead of 25 — with Pro
Lesson: Table Properties Configuration in Application Development
Introduction: The Foundation of Data Architecture
In the realm of enterprise application development, the database table is the fundamental unit of information storage. While many developers focus heavily on the logic layer or the user interface, the integrity, performance, and scalability of an entire system are almost always determined by how well the underlying data structures are defined. Table properties are the specific configurations that dictate how a table behaves, how it interacts with other data entities, how it handles security, and how it performs under heavy load.
Understanding table properties is not merely about knowing which checkboxes to tick in a development environment; it is about understanding the lifecycle of your data. When you define a table, you are essentially creating a contract between the application and the storage engine. If that contract is poorly written—for instance, by choosing the wrong table type or failing to implement proper indexing strategies—the application will suffer from latency, data inconsistencies, and maintenance headaches as the system grows.
This lesson serves as a deep dive into the configuration of table properties within an Application Object Tree (AOT) environment. We will look past the surface-level settings and explore the mechanical implications of these configurations. By the end of this module, you will have the knowledge required to design tables that are not just functional, but optimized for the long-term health of your enterprise applications.
Not read yet
The Anatomy of a Table in the AOT
Before we dive into specific properties, it is essential to visualize the table as an object within the Application Object Tree. A table is defined by its fields, indexes, relations, and, most importantly, its metadata properties. These properties act as the configuration layer that tells the runtime environment how to treat the data.
When you open the properties window for a table in the AOT, you are presented with a vast array of options. These can be grouped into several key categories:
- Identification: Name, Label, and Description.
- Behavioral Properties: TableType, CacheLookup, and ConfigurationKey.
- Data Integrity: SaveDataPerCompany, CreatedBy, CreatedDateTime, and ModifiedBy.
- Performance: OccEnabled, CacheLookup, and Index settings.
Each of these categories serves a distinct purpose. For example, behavioral properties define whether a table is physical (stored in the database) or virtual (computed at runtime). Data integrity properties handle the administrative overhead of tracking who changed what and when. Understanding how these settings interact is the hallmark of a senior developer.
Not read yet
Behavioral Properties: Defining Table Nature
The TableType property is arguably the most critical setting you will encounter. It determines where the data resides and how the system handles the lifecycle of that data.
Standard Tables (Regular)
The vast majority of your tables will be of the Regular type. A regular table is a physical table created in the underlying SQL database. It is persistent, meaning that once you save data into it, that data remains until explicitly deleted or updated. This is the default choice for transactional data, master data, and configuration logs.
InMemory Tables
An InMemory table is a temporary storage structure. Data in an InMemory table exists only for the duration of the user session or the scope of the process that created it. These are excellent for complex calculations, temporary staging of data during an import, or simplifying logic where you need to join disparate datasets that don't share a common foreign key in the permanent database.
Callout: Regular vs. InMemory Tables The primary distinction lies in persistence and scope. Regular tables are committed to the SQL database and are visible globally to all users and processes. InMemory tables are ephemeral; they reside in the application server's memory, are automatically cleared when the process ends, and are private to the session that created them. Use Regular for truth, use InMemory for performance-heavy, transient operations.
TempDB Tables
TempDB tables are a hybrid of sorts. Like InMemory tables, they are temporary and do not contain persistent data across sessions. However, unlike InMemory tables, they are physically backed by the SQL Server’s tempdb database. They are designed to handle large volumes of data that might exceed the available RAM of the application server. If you anticipate your temporary dataset growing to hundreds of thousands of rows, TempDB is the safer architectural choice.
Not read yet
Data Integrity and Auditability
In modern enterprise systems, "who did what and when" is not just a nice-to-have feature; it is a regulatory requirement. The AOT provides built-in properties to automate the tracking of data changes, which saves you from writing custom triggers or manual logging logic.
Automatic Audit Fields
When you set CreatedBy, CreatedDateTime, ModifiedBy, and ModifiedDateTime to Yes, the system automatically injects hidden fields into the table schema. These fields are populated by the runtime whenever a record is created or updated.
- Best Practice: Always enable these fields on master data and transactional tables. It provides a baseline audit trail that is invaluable during debugging sessions or when reconciling data discrepancies.
- Performance Note: While these fields add a marginal amount of overhead to write operations, the trade-off is almost always worth the benefit of having a reliable audit trail.
SaveDataPerCompany
The SaveDataPerCompany property is a cornerstone of multi-entity architectures. When set to Yes, the system automatically appends a DataAreaId column to the table. This allows the same table to store data for multiple legal entities or companies without the data from one company bleeding into another.
Warning: Changing Company Scope Be extremely cautious when changing the
SaveDataPerCompanyproperty on an existing table that already contains data. Doing so will break the existing data links and likely cause the synchronization process to fail or, worse, lead to data loss. This setting should be determined at the design phase before any production data is entered.
Not read yet
Performance Tuning: CacheLookup and OccEnabled
As your application scales, performance becomes the primary bottleneck. The properties CacheLookup and OccEnabled are your primary levers for controlling how the application interacts with the database.
The CacheLookup Property
The CacheLookup property determines how the application caches data from the table into the Application Object Server (AOS) memory.
- None: No caching. Every read request goes directly to the database. This is appropriate for tables that change very frequently or contain massive amounts of data.
- Found: The system caches records as they are requested. If a record is found, it is kept in memory. This is great for reference tables that are accessed repeatedly during a single session.
- NotInTTS: Similar to
Found, but specifically for scenarios where you want to avoid cache invalidation issues within a transaction scope. - EntireTable: The entire table is loaded into the AOS memory. Use this only for small, static lookup tables (like Country Codes or Currency Units). Loading a large table into memory will cause severe memory pressure and degrade system performance.
Optimistic Concurrency Control (OCC)
The OccEnabled property is vital for multi-user environments. When OccEnabled is Yes, the system checks to see if a record has been modified by someone else since you read it. If it has, the system throws an error, preventing you from accidentally overwriting someone else's changes.
- How it works: The system maintains a hidden version field on the table. When you update a record, the system verifies that the version in the database matches the version you originally read. If they don't match, the update is rejected.
- Recommendation: Always enable
OccEnabledfor transactional tables where multiple users might be editing the same record simultaneously.
Not read yet
Practical Implementation: Configuring a New Table
Let’s walk through the configuration of a hypothetical ProjectTask table. This table will store tasks associated with specific projects.
Step-by-Step Configuration
- Create the Table: In the AOT, right-click the Tables node and select "New Table." Name it
ProjectTask. - Set Identification Properties:
Label: "Project Task"Description: "Stores individual tasks associated with internal projects."
- Set Behavioral Properties:
TableType:Regular(We want this data to persist).SaveDataPerCompany:Yes(Our organization has multiple subsidiaries).
- Set Audit Properties:
CreatedBy:YesCreatedDateTime:YesModifiedBy:YesModifiedDateTime:Yes
- Set Performance Properties:
OccEnabled:Yes(Multiple project managers might update tasks at the same time).CacheLookup:None(Tasks are updated too frequently for cache to be effective).
- Add Fields: Add
TaskId(String),TaskName(String),ProjectId(Relation toProjecttable), andDueDate(Date). - Synchronization: Once the properties are set and fields are defined, save the table. The system will prompt you to synchronize the database. This process maps your AOT definition to the actual SQL Server schema.
Not read yet
Code Snippets and Interaction
While you mostly configure table properties in the designer, you will often interact with these properties programmatically. For instance, when writing a query, you need to know how to handle the SaveDataPerCompany logic.
Example: Querying Data with Company Awareness
If you are writing a class to process tasks, the system automatically filters by the current company if SaveDataPerCompany is set to Yes.
// Example of selecting data from our configured ProjectTask table
public void processTasks()
{
ProjectTask projectTask;
// Because SaveDataPerCompany is Yes, this select
// only returns records for the current legal entity.
while select projectTask
where projectTask.DueDate < today()
{
info(strFmt("Processing task: %1", projectTask.TaskName));
}
}
Example: Forcing Cross-Company Access
If you ever need to bypass the SaveDataPerCompany logic to report on tasks across all companies, you must explicitly use the crossCompany keyword.
public void processAllTasks()
{
ProjectTask projectTask;
// This retrieves data from ALL companies,
// overriding the default property behavior.
while select crossCompany projectTask
{
info(strFmt("Task in company %1: %2", projectTask.DataAreaId, projectTask.TaskName));
}
}
Not read yet
Common Pitfalls and How to Avoid Them
Even experienced developers fall into traps when configuring table properties. Here are the most common mistakes and the strategies to avoid them.
1. Over-caching
The Mistake: Setting CacheLookup to EntireTable on a table that is expected to grow.
The Consequence: As the table grows, the AOS memory usage spikes. Eventually, the server will run out of memory, leading to crashes or extreme slowness for all users.
The Fix: Only use EntireTable for small, static configuration tables. If a table has more than 500-1000 records, avoid EntireTable at all costs.
2. Misusing TableType
The Mistake: Using Regular tables for temporary processing logs that are cleared every hour.
The Consequence: The database becomes cluttered with "junk" data, leading to massive transaction log files and slower backup times.
The Fix: Use TempDB or InMemory tables for transient, high-churn data.
3. Ignoring Indexing
The Mistake: Configuring properties perfectly but failing to add indexes on fields used in where clauses.
The Consequence: The database performs "table scans" (reading every single row) instead of "index seeks" (going directly to the data).
The Fix: Every foreign key and every field used in a select statement's where clause should have an index.
4. Changing SaveDataPerCompany Post-Deployment
The Mistake: Toggling SaveDataPerCompany after the table has been deployed to production.
The Consequence: You will lose access to existing data because the system will look for a DataAreaId column that wasn't previously populated or mapped correctly.
The Fix: This is a "design once" property. If you absolutely must change it, you will need to export the data, drop the table, recreate it with the new property, and import the data back—a dangerous and time-consuming operation.
Not read yet
Quick Reference: Table Property Summary
| Property | Default | Recommended for Master Data | Recommended for Transact. Data |
|---|---|---|---|
TableType |
Regular | Regular | Regular |
SaveDataPerCompany |
Yes | Yes | Yes |
CacheLookup |
None | Found | None |
OccEnabled |
No | No | Yes |
CreatedBy |
No | Yes | Yes |
Note: The Importance of Documentation Always use the
Descriptionproperty on your tables. While it seems trivial, large enterprise systems can contain thousands of tables. A clear description acts as documentation for future developers, explaining why a table exists and what its business purpose is.
Advanced Considerations: Configuration Keys
The ConfigurationKey property is a powerful tool for modular development. It allows you to enable or disable entire tables based on licensing or feature flags. If you are developing a module that might not be used by all customers, you should associate your tables with a configuration key.
When the key is disabled, the table and its associated data are effectively hidden from the system. This is a best practice for building "pluggable" architecture where the application can be customized without modifying the core kernel of the system.
Best Practices for Large-Scale Development
- Naming Conventions: Always use consistent prefixes for your tables to avoid naming collisions with standard application objects.
- Field Groups: Use field groups to organize your properties and fields. This makes the user interface (forms) much easier to build, as you can drag and drop groups of fields rather than individual items.
- Indexing Strategy: Do not over-index. While indexes speed up reads, they slow down writes. Only index fields that are genuinely used for filtering or sorting.
- Security: Table properties are the first line of defense. Ensure that your tables are linked to appropriate security privileges. If a user shouldn't see a table, the best way to ensure that is through the security framework, not just by hiding it on the form.
Not read yet
Summary of Key Takeaways
To conclude this module, let's summarize the critical concepts you should carry forward into your development work:
- Behavior is King: The
TableTypeproperty defines the life and death of your data. ChooseRegularfor permanent storage,InMemoryfor small temporary operations, andTempDBfor large temporary datasets. - Auditability is Mandatory: Always enable the automatic audit fields (
CreatedBy,ModifiedBy, etc.) on business-critical tables. It is an industry standard that prevents significant headaches during audits and troubleshooting. - Performance requires Balance: Use
CacheLookupwisely. Caching is a powerful tool for speed, but it comes at the cost of memory. Never useEntireTablecaching on dynamic or large datasets. - Concurrency Control:
OccEnabledis your safeguard against data corruption in multi-user environments. If there is even a small chance that two users might edit the same record, enable OCC. - Think Before You Synchronize: Properties like
SaveDataPerCompanyare permanent architectural decisions. Changing them after data has been populated is a high-risk operation that should be avoided at all costs. - Design for the Future: Use
ConfigurationKeysto make your tables modular. This ensures that your system remains maintainable and that features can be toggled on or off without requiring a full code refactor. - Indexes are Mandatory for Performance: A table is only as fast as its indexes. Always pair your property configurations with a thoughtful indexing strategy that aligns with your most frequent query patterns.
By mastering these table properties, you move from being a developer who "writes code" to one who "designs systems." The ability to configure these objects correctly is what separates a fragile, slow application from one that is robust, performant, and easy to maintain over a decade of use. Take the time to test your configurations in a development environment, analyze the SQL execution plans, and ensure that your table properties align with the actual usage patterns of your application.
Not read yet
Each section gets a ✓ as you scroll through it. Tap the button to jump to the next one.
Spend your points to unlock exam-style practice questions
Spend points to unlock MB-500 exam-style practice questions.
Practice for MB-500