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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 28.10.2006, 19:01   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
Dave: Creating Header/Detail-based Linkage On One Form
Источник: http://daxdave.blogspot.com/2006/10/...inkage-on.html
==============
I have been struggling with a seemingly simple concept over the past couple days: How to setup a form that has two grids where one grid represents header-level data and the other grid represents detail-level data with the proper linkage. In all of the books, newsgroups, and blogs out there no one has yet to tackle documenting this seemingly simple task until now. I managed to get the form running tonight and I am posting this in case someone else may be struggling just like I have been. In my struggles I tried to mimic both the architecture and properties of both the SalesTable and SysEmailTable forms which have Header and Detail grids. Even after duplicating what these two forms use, my form still did not work properly. In all cases my detail form showed all records no matter which header record I placed focus on. Below is the steps that I have verified that successfully develops a header and detail grid. There may be other ways to accomplish this but this process definitely works.

1.) SETUP THE DATABASES: If you have not already, create your header records table and your detail records table.
a. Creation of your tables should include adding the appropriate Extended Data Types to your table for the fields you would like it to have.
b. Your Detail table should include the field that is in your Header table that you wish to use as the key between the two tables.
c. Add Indexes to both tables while including the key to your header table in the index along with including the same field that is in your Detail table as part of the index.
d. Add a relation to the Detail table to join the fields that appear in both the Header and Detail tables together.
e. If you wish to prevent database anomalies, add a DeleteAction to the Header table that performs a 'Cascade' DeleteAction on the Detail table.
2.) LINK DATABASES TO FORM: Drag the Header and Detail table into the Data Sources node of the Form you wish to use to display the two.
a. Set the Detail table's properties JoinSource property to the name of the Header table and verify the LinkType is set to Delayed.
b. If you do not want AX to automatically add a new record if no records exist, set InsertIfEmpty to 'No' in the Data Source properties of the Detail and/or Header data sources.
3.) DESIGN FORM FROM DATABASES: Add the appropriate container hierarchy to your form design and add the appropriate fields to each.
a. In my form, I created three groups within the form: Header, ControlSplit, and Detail.
b. The Header Group contains a Tab, within the Tab a TabPage, and within the TabPage a Grid control. The Grid control's datasource property is set to the Header table.
c. The Detail Group contains a grid control with the datasource property set to the Detail table.
d. Within the Header and Detail Group's grid, I dragged the appropriate fields/field groups into their respective grids.

Using these steps you should be able to correctly link Header Table data within a form to Detail Table data where only Detail Table data is displayed based upon the current Header Table data record.

I hope this helps those of you who maybe new to AX like myself and are struggling with a similar problem.


==============
Источник: http://daxdave.blogspot.com/2006/10/...inkage-on.html
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
palleagermark: Creating an image file based on plain text from AX Blog bot DAX Blogs 0 03.03.2009 03:08
dax-lessons: Problem when creating a dynamic form with ActiveX control & Solution :) Blog bot DAX Blogs 0 30.04.2008 16:05
Dave: Creating 'Permanent' Indexes on DataAreaId in Dynamics AX Blog bot DAX Blogs 0 29.02.2008 05:37
Issues concerning X++: Pen based form demo Blog bot DAX Blogs 0 31.10.2007 23:40
Говорят вышел SP2 для Axapta 3. Кто нибуть что знает на эту тему? soin DAX: Прочие вопросы 10 13.10.2003 10:43

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

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

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 19:52.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.