[FormControlEventHandler(formControlStr(DTWorkerDimensionForm, DTWorkerDimTbl_DTDepartment), FormControlEventType::Lookup)]
public static void DTWorkerDimTbl_DTDepartment_OnLookup(FormControl sender, FormControlEventArgs e)
{
Query query = new Query();
QueryBuildDataSource queryBuildDataSource;
QueryBuildRange queryBuildRange;
SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(FinancialDimensionValueEntityView),sender,true);
sysTableLookup.addLookupField(fieldNum(FinancialDimensionValueEntityView,DimensionValue));
sysTableLookup.addLookupField(fieldNum(FinancialDimensionValueEntityView,Description));
queryBuildDataSource = query.addDataSource(tableNum(FinancialDimensionValueEntityView));
queryBuildRange = queryBuildDataSource.addRange(fieldNum(FinancialDimensionValueEntityView,DimensionAttribute));
queryBuildRange.value('Department');
sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
FormControlCancelableSuperEventArgs ce = e as FormControlCancelableSuperEventArgs;
//cancel super() to prevent error.
ce.CancelSuperCall();
}
[FormControlEventHandler(formControlStr(DTWorkerDimensionForm, DTWorkerDimTbl_DTDepartment), FormControlEventType::Lookup)]
public static void DTWorkerDimTbl_DTDepartment_OnLookup(FormControl sender, FormControlEventArgs e)
{
Query query = new Query();
QueryBuildDataSource queryBuildDataSource;
QueryBuildRange queryBuildRange;
SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(DefaultDimensionView),sender,true);
sysTableLookup.addLookupField(fieldNum(DefaultDimensionView,DisplayValue));
sysTableLookup.addLookupMethod(tableMethodStr(DefaultDimensionView, dimensionDiscription));
queryBuildDataSource = query.addDataSource(tableNum(DefaultDimensionView));
QueryBuildDataSource.orderMode(OrderMode::GroupBy);
QueryBuildDataSource.addGroupByField(fieldNum(DefaultDimensionView,DisplayValue));
queryBuildRange = queryBuildDataSource.addRange(fieldNum(DefaultDimensionView,Name));
queryBuildRange.value('Department');
sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
FormControlCancelableSuperEventArgs ce = e as FormControlCancelableSuperEventArgs;
//cancel super() to prevent error.
ce.CancelSuperCall();
}
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,349 Super User 2024 Season 2
Martin Dráb 228,212 Most Valuable Professional
nmaenpaa 101,148