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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 26.11.2012, 11:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,644 / 848 (80) +++++++
Регистрация: 28.10.2006
Malaysia: Using a form for building a lookup
Источник: http://axmas.blogspot.com/2012/11/us...ng-lookup.html
==============


1. In the AOT, create a new form named CustLookup. Add a new data source with the
following properties:
Property Value
Name CustTable
Table CustTable
Index AccountIdx
AllowCheck No
AllowEdit No
AllowCreate No
AllowDelete No
OnlyFetchActive Yes

2. Change the properties of the form's design as follows:
Property Value
Frame Border
WindowType Popup

3. Add a new Grid control to the form's design, with the following properties:
Property Value
Name Customers
ShowRowLabels No
DataSource CustTable

4. Add a new StringEdit control to the grid, with the following properties:
Property Value
Name AccountNum
AutoDeclaration Yes
DataSource CustTable
DataField AccountNum


5. Add a new ReferenceGroup control to the grid with the following properties, right
after the AccountNum:
Property Value
Name Name
DataSource CustTable
ReferenceField Party

6. Add one more StringEdit control to the grid with the following properties, right
after the Name:
Property Value
Name Phone
DataSource CustTable
DataMethod phone

7. Add a new ComboBox control with the following properties to the end of the
Customers grid:
Property Value
Name Blocked
DataSource CustTable
DataField Blocked

8. Override the form's init() method with the following code:
public void init()
{
super();
element.selectMode(AccountNum);
}

9. Override the form's run() method with the following code:
public void run()
{
FormStringControl callingControl;
boolean filterLookup;
callingControl = SysTableLookup::getCallerStringControl(
element.args());

filterLookup = SysTableLookup::filterLookupPreRun(callingControl, AccountNum, CustTable_ds);
super();
SysTableLookup::filterLookupPostRun(filterLookup, callingControl.text(), AccountNum, CustTable_ds);
}

10. Finally, override the init() method of the CustTable data source with the
following code:
public void init()
{
Query query;
QueryBuildDataSource qbds;
QueryBuildRange qbr;
query = new Query();
qbds = query.addDataSource(tableNum(CustTable));
qbr = qbds.addRange(fieldNum(CustTable,Blocked));
qbr.value(queryvalue(CustVendorBlocked::No));
this.query(query);
}

11. The form in the AOT should look similar to the following screenshot:



12. Locate the CustAccount extended data type in the AOT, and change its property
as follows:

Property Value
FormHelp CustLookup

13. To test the results, open Sales and marketing | Common | Sales orders | All sales
orders, and start creating a new sales order. Notice that now the Customer account
lookup is different, and it includes only active customers:








Источник: http://axmas.blogspot.com/2012/11/us...ng-lookup.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
dynamicsaxtraining: Vendor returns Blog bot DAX Blogs 0 11.10.2012 00:11
dynamicsaxtraining: Purchase Blog bot DAX Blogs 0 11.03.2012 05:25
CRM DE LA CREME! Some more useful javascripts for MS CRM Blog bot Dynamics CRM: Blogs 0 04.05.2010 11:05
Kashperuk Ivan: Lookup form returning more than one value Blog bot DAX Blogs 0 29.01.2010 18:05
gatesasbait: How to define a custom lookup form for an extended datatype Blog bot DAX Blogs 0 09.07.2008 22:05

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

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

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