Wednesday, 18 January 2017

3.2 Tables [AX 2012]



3.2.1 Get table properties through X+

SysDictField dict = new SysDictField(tableId, fieldId);
str label = dict.label();

3.2.2 Table Contents

Specifies how setup/parameter data can be reused from one customer to another. The following values are possible:

Not specified – For most tables.

Default Data – Use for customer-independent data such as ZIP/Postal Codes, units, and time intervals.

Base Data – Use for customer-dependent data such as calendars, groups, and parameters.

Default+Base data – Use for data where the local perception varies. For example, Chart of Accounts is not customer-dependent in Germany, but is most other places in the world.



3.2.3 Cache LookUp

None

No data is cached or retrieved from the cache for this table.
This property value should be used for tables that are heavily
updated or where it’s unacceptable to read outdated data.

NotInTTS

All successful caching key selects are cached.
When in a transaction (after ttsBegin), no caches made outside

the transaction are used. When inside a transaction, the record
is read once from database and subsequently from the cache.
The record is select-locked when read in a transaction, which
ensures that the record cached is not updated while the
transaction is active.

A typical example of the NotInTTS property is on theCustTable
in the Microsoft Dynamics AX application. It is acceptable to
read outdated data from the cache outside a transaction, but
when data is used for validation or creating references, it is
ensured that the data is real-time.


Found

All successful caching key selects are cached. All caching key
selects are returned from the cache if the record exists there. A select forUpdate in a transaction forces reading from the

database and replaces the record in the cache.
This is typically used for static (lookup) tables, such as Unit,
where the record usually exists.


FoundAndEmpty

All selects on caching keys are cached, including selects that
are not returning data.
All caching key selects are returned from caching if the record

exists there, or the record is marked as nonexistent in the cache. A select forUpdate in a transaction forces reading from the

database and replaces the record in the cache.
An example of FoundAndEmpty record caching is in the

Discount table in the Microsoft Dynamics AX standard application.
By default, the Discount table has no records. By using a FoundAndEmpty cache on this table, the keys that are queried
for but not found are stored in the cache. Subsequent queries for
these same non-existent records can be answered from the cache without a round trip to the database.


EntireTable

Creates a set-based cache on the server. The entire table is
cached
as soon as at least one record is selected from the table.

Table GroupCache 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.
Finally, bear in mind that in AX 2012, the cache limit is configurable for every table group in the 
server performance settings:
System Administration > Setup > System > Server Configuration > Performance optimisation tab
Entire table cache size determines in kilobytes how much data is cached in memory before 
spilling to disk. The defaults are 32KB for AX 2012 RTM and 96KB for AX 2012 R2/R3.

No comments:

Post a Comment