AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 11.04.2017, 08:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,631 / 848 (80) +++++++
Регистрация: 28.10.2006
InMemory and TempDB in joins on forms
Источник: http://alexvoy.blogspot.com/2017/04/...-on-forms.html
==============

One of the tricky point of the previously announced project for AIF external code mapping and Reverse view is the usage of temporary tables in the latter's form.

As we know there are two different temporary table types in AX 2012: InMemory and TempDB.

In my project I needed to join a temporary table with internal values to the regular table with external codes.

"Cannot select a record in xxxx.
InMemory temporary tables must be the outer tables when they are joined to a TempDB table or permanent table."

How to avoid this famous error?

Brief, I need to populate the temp buffer at the server side and then to pass it to the form data source.

The easiest way to understand how they are processed by AX is switching the type for and debugging then the Reverse view form opening in Init and temporary table populating method. Seeing is believing.

This is how Reverse View regular and temp table are joined.





Let's start with InMemoryType. The form considers it as the client tier based table.



In the server based populating method, we need to instantiate the local temp buffer and then set it to the argument buffer via setTmpData() method so that it was still on the server tier. Old school.


Then the same approach to set it to the caller data source. Our temp InMemory table is still on the server and can be joined.


Now, change the table type to TempDB and debug it again. As you can see the form determines it as the server based object.


This time we need to insert new records directly to the argument buffer so that it could be linked to the caller form data source via linkPhysicalTableInstance() method.



If do not have any special reason, the TempDB is recommended to use.







Источник: http://alexvoy.blogspot.com/2017/04/...-on-forms.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
TempDB для SSRS kitty DAX: Программирование 11 01.12.2020 16:57
dynamicscare: Error Fixed: Table ‘ShipCarrierTracking’ of type TempDB cannot be changed to table of type InMemory. Blog bot DAX Blogs 0 12.12.2012 00:11
kamalblogs: Dynamics ax 2012 – Copying Temp Table instance for SQL TempDB Blog bot DAX Blogs 0 12.07.2012 00:14

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 16:01.