Tuesday, July 13, 2021

Lookup Cache Property in Dynamics 365 finance and operations

 

Cache Lookup

result

None

No data is cached or retrieved from the cache for the table.
This property value should  not  be used, but would  be the use case for tables that are very up-to-date or where it is acceptable to read outdated data.

NotInTTS

When s  records  are selected  by a  Primary Key or a unique index,  the registry value  is cached when within   a transaction (after  ttsBegin). No cache scans made outside the transaction are used. When inside a transaction, the record is read once from the database and later from  the cache. The record  is locked by select when read in a transaction, which ensures that  the cached record is not updated when the transaction is active.

Found

When records are selected by a Primary Key or a unique index, the record value is cached for the duration of the if they are or until the record is updated. All "selects"  return the cache value if the record exists there.  Um "select for Update" in a transaction forces the database read and  replaces the cached record.
It is typically used for static  (lookup)tables,such as the Unit table, where records usually exist.

FoundAndEmpty

It has the same functionality as Found,except that if "select"does not return data,the absence of a record  is  cached. 
An example of  FoundAndEmpty  is the Discount  table , which by default has no records. Because "select"has not returned data,this information will be cached. Subsequent queries for the same nonexistent records  will return the cached value without reading from the database. A "select for Update" in a transaction forces the database to read and replaces the record in the cache.

EntireTable

The entire table is cached on the server as soon as at least one record is selected from the.
And a  cache setting is appropriate  for tables with a  known  number of limited records, such as parameter tables.


You can usually set the Lookup Cache of  a table according to the relationship  below,  however there   may be exceptions.

Table Group

Cache Lookup

Miscellaneous*

Do not use  and this Table Group  for custom tables.

Parameter

EntireTable

Group

Found

Main

Found

Transaction,
TransactionHeader
,and  TransactionLine

NotInTTS

Framework

Does not apply

Reference

Found

Worksheet,
WorksheetHeader,

and WorksheetLine

NotInTTS

Hope you find this helpful and will come up with another interesting blog post!


No comments:

Post a Comment