Dynamics 365 Business Central: TableType Property = Temporary

Dynamics 365 Business Central

Hi readers.
In my previous blog, we talked about two solutions to optimize performance of Business Central.
Dynamics 365 Business Central: QueryCategory property (Execute Queries from Pages)
Dynamics 365 Business Central: Record.SetLoadFields Method (Partial Records)

This time I want to share another new feature in Dynamics 365 Business Central 2020 release wave 2. Many expects may have noticed it. Yes, it is TableType Property = Temporary.
MS Docs:
TableType Property

TemporarySpecifies the table as an in-memory only table in the Business Central Server. This table type isn’t synchronized to the Dynamics 365 Business Central database. Specifies the table as an in-memory only table in the Business Central Server. This table type isn’t synchronized to the Dynamics 365 Business Central database.

APPLIES TO: Dynamics 365 Business Central 2020 release wave 2 and later.

PS: This feature is also absent in NAV.
For Example NAV2018:

Before BC17, if you want to use temporary tables, there are two ways.
1. using a temporary record variable

2. setting the SourceTableTemporary property on a page to true

Now there is a final solution, setting TableType property of a table to Temporary.

Let’s try it.
Enter some data on the list page.

Close and reopen it. No data are saved. Same as setting the SourceTableTemporary property to true on the page.

If I delete some fields or change the Primary key in the table.

When I published it with Synchronize mode, there were no errors. That’s great, so the table does not have restrictions on breaking schema changes. This will be very helpful.

If the table is not setting to Temporary, you cannot delete fields and modify primary key with Synchronize mode like update extension in Production Environment.

[2020-10-14 17:19:37.68] The request for path /v2.0/Sandbox/dev/apps?SchemaUpdateMode=synchronize&DependencyPublishingOption=default failed with code UnprocessableEntity. Reason: Table ZY Book :: フィールド ‘Title’ が見つかりません。フィールドの削除は許可されていません。

I think that if the table is only used as a temporary table in Business Central, it is better for developers to use this feature from now on.

END

Hope this will help.

Thanks.

コメント

タイトルとURLをコピーしました