Enter the key words to find the related topics

Table properties : CacheLookup

Table Group Cache Lookup
Miscellaneous*  See notes below
 Parameter  EntireTable
 Group  Found
 Main  Found
 Transaction  NotInTTS
 WorksheetHeader  NotInTTS
 WorksheetLine  NotInTTS
 Framework  N/A
 Reference  Found
 Worksheet  NotInTTS
 TransactionHeader  NotInTTS
 TransactionLine  NotInTTS
 All newly created tables default to a table group of Miscellaneous. Ideally don’t use this table group for custom tables.




Table properties : TableGroup

Table group
Use this group for a table with these characteristics
Examples
Parameter
The table contains data primarily used as parameters or setup information for one of the main tables (a table that has a TableGroup property of Main).
The table typically contains only one record per company.
CustParameters, VendParameters
Group
The table contains data primarily used to categorize one of the main tables (a table that has a TableGroup property of Main).
There is a one-to-many relationship between a Group table and a Main table.
CustGroup, VendGroup
Main
The table is one of the principal tables in the application and contains data for a central business object.
The table typically holds static, base information.
There is a one-to-many relationship between the Main table and a Transaction table.
CustTable, VendTable
Transaction
The table contains transaction data.
The table is typically not used for data entry directly.
CustTrans, VendTrans
WorksheetHeader
The table typically categorizes information in the WorkSheetLine tables.
There is a one-to-many relationship between a WorkSheetHeader table and a WorkSheetLine table.
SalesTable
WorksheetLine
The table contains information to be validated and made into transactions.
In comparison to the data contained in a Transaction table, the data in WorkSheetLine tables is temporary and may be deleted without affecting system stability.
SalesLine
Miscellaneous
The table does not fit in any of the other categories. This is the default value for a new table.
TableExpImpDef

Table properties : TableType

It has three dropdown 
  • Regular
  • InMemory
  • TempDB


Regular:




The default value. These are permanent Tables. These tables are used for storing data permanently in the database.

InMemory:

  • InMemory tables are never represented in the database management system. 
  • The memory or disk space for the InMemory table is de-allocated as soon as the record buffer goes out of scope. 
  • To free the memory and delete the file for the InMemory table, set the record buffer variable to null as follows.
                                custTmpLedger = null;
  • The setTmp method is used to create an InMemory table from the Regular table.
  • Indexes are useful for quickly retrieving data from InMemory tables, especially if the InMemory table data is in a disk file.
  • The following code example copies data from the CustTable table into an InMemory table that is a copy of the CustTable table structure.
    static void CopyPersistedTableToInMemoryJob(Args _args)
    {
        CustTable custTable;
        CustTable custTmpLedger;
 
        custTmpLedger.setTmp();
        custTable.recordLevelSecurity(true);
 
        while select * from custTable where custTable.AccountNum like '1*'
        {
            custTmpLedger.data(custTable.data());
            custTmpLedger.doInsert();
            info(strFmt("Inserted a row for AccountNum = %1",custTable.AccountNum));
        }
 
        custTmpLedger = null;
    }

TempDB




InMemory tablesTempDB tables
1. Holds data temporarily in client or server tier1. Holds data temporarily in the database until the scope is valid
2. These tables can't be stored in Database2. These tables are stored in the database
3. Can't apply security3. Can apply security
4. We cannot use InMemory table buffers4. TempDB table buffer can be used in coding
5. SetTmp method to set the regular table to InMemory5. linkPhysicalTableInstance method to set the regular table to TempDB
6. Can't apply joins                                  6. Can apply Joins                                                     

How to use Temp table as data source of form in AX 2012

Yes, you can use temporary table as datasource whether it is of type tempDb or InMemory.

I assumed that you have temporary table ready and just need to drag in to the form datasource.

Now, Create one method named insertRecords at form level.

eg.,

TmpTable insertRecords()
{

TmpTable tmpTableBuffer;
OtherTable otherTableBuffer;

while tmpTableBuffer
{
tmpTableBuffer.field1 = otherTableBuffer.field1;
.
.
.
.
.
tmpTableBuffer.fieldn = otherTableBuffer.fieldn;
tmpTableBuffer.insert();
}

Now, call this method in init method of form after super.

public void init()
{

super();

// important thing comes here
// if table is of type InMemory,call following method.

TmpTable.setTmpData(element.insertRecords());

// if table is of type tempDb, call following method.

TmpTable.linkPhysicalTableInstance(element.insertRecords());
}

Table properties : Table contents


Table properties : Replacement Key


Table properties : Cluster index


Table properties : Support Inheritance

Support Inheritance:
Default value : NO
 Properties Abstract and Extends will be disabled when Support Inheritance is NO.
To create an Inheritance Parent table (Base table) we need to follow below steps:
  • Int64 field 
  • Field name as InstanceRelationType(Parent table)
  • Extends with RelationType.
  • Support Inheritance Property to YES
To create an Inheritance Child table (drived table) we need to follow below steps:
  • Support Inheritance Property to YES
  • Extends Property to the Parent table
(In AX 2012 we need to create a field and set the property to InstanceRelationType to InstanceRelationType field whereas in D365 creates the field automatically when we set Support Inheritance to YES).

IS and AS keywords are used for Inheritance.

Whereas IS keyword is used whether an object is a subtype of a specified class/Table.

AS keyword for assignments that downcast from a base class variable to a derived class variable.

Abstract versus concrete tables:

Tables in a table inheritance hierarchy can be defined as either abstract or concrete, depending on whether the table property Abstract is set to Yes or No. Records can only be created for concrete table types. Any attempt to create a record and insert it in an abstract table will result in a run-time error. The position of the table in the inheritance hierarchy does not restrict its ability to be defined as abstract.

(If Abstract property set to YES, we can't create the records in the parent table.)