Показать сообщение отдельно
Старый 14.09.2017, 13:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
alirazazaidi: Custom financial Dimension shows in lookup D365 for Finance and operations
Источник: https://www.tech.alirazazaidi.com/cu...nd-operations/
==============

I one of last post, I added the custom financial dimension in D365 for finance and operations.
You can find this post here
https://www.tech.alirazazaidi.com/cu...erations-ax-7/

In next post I load financial dimension in custom lookup.
Custom lookup for Financial Dimension D365 for Finance and Operations (Dynamics Ax 7)

But above link shows only out of the box financial dimensions. But what about custom financial dimension,

I tested the following code snippet works custom dimension. It load custom dimension mentioned in
Custom Financial Dimension in Dynamics 365 for Finance and Operations (AX 7)


[FormControlEventHandler(formControlStr(FrmTestDetail, FormStringControl1), FormControlEventType::Lookup)]
public static void FormStringControl1_OnLookup(FormControl sender, FormControlEventArgs e)
{

SysTableLookup sysTableLookup;
Query query;
QueryBuildDataSource qbdsDimensionFinancialTag;
QueryBuildRange qbrFinancialTagCategory;
String20 LC;
RecId _recid;
DimensionAttribute _attribute;
Name _name=’jaggah_tax’;

;
// super();

//#define.MyCustomFinancialDimension(‘LC’)
// select * from attribute where attribute.Name ==_name;
// recid = attribute.financialTagCategory();

query = new Query();
qbdsDimensionFinancialTag = query.addDataSource(tableNum(DimensionFinancialTag));
qbrFinancialTagCategory = qbdsDimensionFinancialTag.addRange(fieldNum(DimensionFinancialTag, FinancialTagCategory));
qbrFinancialTagCategory.value(strFmt(‘%1’, DimensionAttribute::findByName(_name, false).financialTagCategory()));

sysTableLookup = sysTableLookup::newParameters(tableNum(DimensionFinancialTag), sender,true);
sysTableLookup.addLookupfield(fieldNum(DimensionFinancialTag, Value), true);
sysTableLookup.addLookupfield(fieldNum(DimensionFinancialTag, Description));
sysTableLookup.addSelectionField(fieldNum(DimensionFinancialTag, FinancialTagCategory));
sysTableLookup.parmQuery(query);

sysTableLookup.performFormLookup();

FormControlCancelableSuperEventArgs ce = e as FormControlCancelableSuperEventArgs;
//cancel super() to prevent error.
ce.CancelSuperCall();

}

Output is here





Источник: https://www.tech.alirazazaidi.com/cu...nd-operations/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.