Hello.
I created a lookup method that shows the Displayvalues and names of certain Financial dimensions. (Business Area - custom dimension)
However, I can see DisplayValue well, but I can't see any Dimension Name.
//[FormControlEventHandler(formControlStr(SalesCreateOrder, DimensionLookupControl), FormControlEventType::Lookup)]
//public static void DimensionLookupControl_OnLookup(FormControl sender, FormControlEventArgs e)
[FormControlEventHandler(formControlStr(SalesCreateOrder, SalesTable_TYM_AR_BusinessArea), FormControlEventType::Lookup)]
public static void SalesTable_TYM_AR_BusinessArea_OnLookup(FormControl sender, FormControlEventArgs e)
{
// FormStringControl control = dialog.formRun().controlCallingMethod();
Query query1 = new Query();
QueryBuildDataSource queryBuildDataSource;
QueryBuildRange queryBuildRange;
DimensionAttribute dimAttr;
;
dimAttr = DimensionAttribute::findByName("BusinessArea");
SysTableLookup sysTableLookup = SysTableLookup::newParameters(tablenum(DimensionAttributeValue), sender);
query1.addDataSource(tablenum(DimensionAttributeValue)).addRange(fieldNum(DimensionAttributeValue,DimensionAttribute)).value(queryValue(dimAttr.RecId));
sysTableLookup.addLookupfield(fieldNum(DimensionAttributeValue, DisplayValue));
sysTableLookup.addLookupMethod(tableMethodStr(DimensionAttributeValue, getname));
//this code is to add the ranges for filtering
sysTableLookup.parmQuery(query1);
sysTableLookup.performFormLookup();
}