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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 20.03.2012, 19:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
emeadaxsupport: In Microsoft Dynamics AX 2012 the Default account setup Lookup form is listing Main Accounts from all Company Accounts rather than just active Company Accounts
Источник: http://blogs.msdn.com/b/axsupport/ar...-accounts.aspx
==============

We came across an issue recently where the “Default account setup" Lookup form is listing Main Accounts from all Company Accounts. We are using Microsoft Dynamics AX 2012 CU-2. The selection in some queries brought unexpected results. For example: Under Accounts payable > Setup > Vendors > Vendor groups. Then select one Vendor and click “Default account setup”. The look up will then list the Main Accounts from all Company Accounts instead of only the current active Company Account.

The results are derived as a result of the where clause selection in \Data Dictionary\Tables\VendDefaultAccounts\Methods\notSelectedLedgerAccountList method


We worked around the issue by changing one line of code in the notSelectedLedgerAccountList method from

...

outer join RecId from dimAttributeValueCombo where
dimAttributeValueCombo.DisplayValue == mainAccount.MainAccountId &&
dimAttributeValueCombo.LedgerDimensionType == LedgerDimensionType::DefaultAccount

...

to:

...

outer join RecId from dimAttributeValueCombo where
dimAttributeValueCombo.MainAccount == mainAccount.RecId &&
dimAttributeValueCombo.LedgerDimensionType == LedgerDimensionType::DefaultAccount

...



For completeness, the full method code and modified line is shown in the highlight below:



public server static List notSelectedLedgerAccountList()
{
MainAccount mainAccount;
DimensionAttributeValue dimAttributeValue;
DimensionAttributeValueCombination dimAttributeValueCombo;
VendLedgerAccounts vendLedgerAccounts;
List notSelectedFieldList = new List(Types::Container);
recId defaultAccountHierarchyId =
DimensionHierarchy::getHierarchyIdByHierarchyType(DimensionHierarchyType::DefaultAccount);
recId mainAccountDimAttribute =
DimensionAttribute::getMainAccountDimensionAttribute();

// Allow all posting types, so long as they are not closed
// Only add the combination if it doesn't exist or doesn't exist as a ledger dimension on the
vendLedgerAccounts table
while select MainAccountId, Name, Type from mainAccount order by MainAccountId where
mainAccount.LedgerChartOfAccounts == LedgerChartOfAccounts::current() &&
mainAccount.Type != DimensionLedgerAccountType::Total
outer join RecId from dimAttributeValueCombo where
//dimAttributeValueCombo.DisplayValue == mainAccount.MainAccountId && //original code
dimAttributeValueCombo.MainAccount == mainAccount.RecId && //modified Code
dimAttributeValueCombo.LedgerDimensionType == LedgerDimensionType::DefaultAccount
outer join RecId from vendLedgerAccounts where
(vendLedgerAccounts.SummaryLedgerDimension == dimAttributeValueCombo.RecId ||
vendLedgerAccounts.ClearingLedgerDimension == dimAttributeValueCombo.RecId ||
vendLedgerAccounts.PurchasingLedgerDimension == dimAttributeValueCombo.RecId ||
vendLedgerAccounts.PurchasingOffsetLedgerDimension == dimAttributeValueCombo.RecId)
notexists join dimAttributeValue where
dimAttributeValue.DimensionAttribute == mainAccountDimAttribute &&
dimAttributeValue.EntityInstance == mainAccount.RecId &&
(dimAttributeValue.IsSuspended == true ||
dimAttributeValue.IsBlockedForManualEntry == true)
{
if (!vendLedgerAccounts)
{
notSelectedFieldList.addEnd([mainAccount.MainAccountId, mainAccount.Name, mainAccount.Type]);
}
}
return notSelectedFieldList;
}

Disclaimer:
This programming example is for illustration purposes only. Microsoft disclaims all warranties and conditions with regard to use of the programming example for other purposes. Microsoft shall not, at any time, be liable for any special, direct, indirect or consequential damages, whether in an action of contract, negligence or other action arising out of or in connection with the use or performance of the programming example. Nothing herein should be construed as constituting any kind of warranty.



--author:Mansour Yahya Mohamad Mansour


Источник: http://blogs.msdn.com/b/axsupport/ar...-accounts.aspx
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
rumicrosofterp: Dynamics AX на Convergence 2012 Blog bot Microsoft и системы Microsoft Dynamics 0 13.01.2012 11:11
Microsoft Dynamics CRM Team Blog: Update Rollup 5 for Microsoft Dynamics CRM 2011 Blog bot Dynamics CRM: Blogs 2 27.10.2011 17:11
mfp: Microsoft Dynamics AX 2012 is here! Blog bot DAX Blogs 10 04.08.2011 17:11
DynamicsAxSCM: Operational Sites in Microsoft Dynamics AX 2012 Blog bot DAX Blogs 0 25.05.2011 19:11
DynamicsAxSCM: Sales and purchase prices in relation to the item price setup in Microsoft Dynamics AX 2009 Blog bot DAX Blogs 0 11.02.2010 09:05

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

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

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