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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 03.11.2016, 03:34   #1  
Blog bot is offline
Blog bot
Участник
 
25,459 / 846 (79) +++++++
Регистрация: 28.10.2006
stoneridgesoftware: Changing a Relationship Precedence in Dynamics AX
Источник: https://stoneridgesoftware.com/chang...n-dynamics-ax/
==============

Have you ever been in a scenario where a data source has more than one relationship to a table it is being linked to? I have. It wasn’t a problem until I wanted the second relationship to take priority.

So the real question is, how to specify what relationship should the table use?





In my example, on the InventTable I have multiple relationships defined. Please note though:

InventTable.AlcholoManufacturerID_RU == VendTable.AccountNum InventTable.PrimaryVendorId == VendTable.AccountNum

On my form: EcoResProductDetailsExtended, I added VendTable as a data source.

Well, how does AX know which relationship I want take precedence? By default, AX uses the first one. In this case, the AlcoholManufacturer_RU relationship takes precedence.





To change what relationship takes precedence I overloaded the init() method.





  1. First, you must tell the data source what relationship you want to use.
vendtable_ds.joinRelation("PrimaryVendTable"); 2. Second, you must make the relationship the active relationship.
VendTable_ds.linkActive(); 3. Third, you must execute the query.
vendtable_ds.executeQuery(); </p> It is important to note, this must all be done before the super(). By following these simple steps, you will set a tables relationship precedence on a data source with more than one defined relationship.

Your init() method should look like the following.

public void init() { vendtable_ds.joinRelation("PrimaryVendTable"); VendTable_ds.linkActive(); vendtable_ds.executeQuery(); super(); }



Источник: https://stoneridgesoftware.com/chang...n-dynamics-ax/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
axforum blogs: Квест: Подружим Dynamics Ax 2009 Sp1 RU7 c SharePoint Foundation 2010 Blog bot DAX Blogs 4 16.10.2017 17:50
stoneridgesoftware: TFS Code Repository and Dynamics AX Blog bot DAX Blogs 0 16.06.2016 16:11
crminthefield: Podcast and Overview: Microsoft Dynamics CRM 2011 Update Rollup 16 Blog bot Dynamics CRM: Blogs 0 23.01.2014 03:15
crminthefield: Podcast and Overview: Microsoft Dynamics CRM 2011 Update Rollup 12 Blog bot Dynamics CRM: Blogs 0 30.01.2013 01:11
DAX: Official Dynamics AX 2012 R2 Content (update) - Where is it, and how can you find out about updates? Blog bot DAX Blogs 0 03.12.2012 11:11
Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

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

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

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