How to utilize the table properties in X++?
Scenario: When a user creates a table, it is necessary to set the appropriate table properties to ensure data integrity, improve performance and enhance overall usability.
High Resolution steps
- Create a field in table.
- Create a Primary Index.
- Create a Cluster Index.
- Set the table properties.
- Establishing the table relationship.
Detailed Resolution steps:
Step 1: Create a field in the table and set its extended data type to “DAXEmployeeId.”
Navigation: DAXLeaveAppTable -> EmployeeID -> DAXEmployeeID.
Step 2: To create a primary index for a table and set the necessary properties for the index field.
Note: Drag and drop the EmployeeID (Primary key) under indexes.
Navigation: DAXLeaveAppTable -> Indexes -> Properties.
Step 3: To create a clustered index for a table and set the necessary properties for the index field.
Note: Drag and drop the EmployeedId (Primary key) under indexes.
Navigation: DAXLeaveAppTable -> Indexes -> Properties.
Step 4: To set the cache lookup and table group properties for the header table
Table Properties:
Cache Lookup: Set the Cache Lookup property to “NotInTTS.”
Note: When in a transaction (after ttsBegin), no caches made outside the transaction are used. When inside a transaction, the record is read once from the database.
Table Group: Assign the Table Group property to “WorksheetHeader.”
Note: Using the “WorksheetHeader” property helps enhance data organization, improves access efficiency, simplifies coding, maintains consistency and aids in effective reporting.