最新消息:ww12345678 的部落格重装上线,希望大家继续支持。

Custom financial Dimension shows in lookup D365 for Finance and operations

网络文摘 alirazazaidi 2748浏览 0评论

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/custom-financial-dimension-in-dynamics-365-for-finance-and-operations-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

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址