/// <summary>
///
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
[FormControlEventHandler(formControlStr(DTWorkerDimensionForm, DTWorkerDimTbl_DTBuisnessUnit), FormControlEventType::Lookup)]
public static void DTWorkerDimTbl_DTBuisnessUnit_OnLookup(FormControl sender, FormControlEventArgs e)
{
Query query = new Query();
QueryBuildDataSource queryBuildDataSource;
QueryBuildRange queryBuildRange;
SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(DimAttributeOMBusinessUnit),sender,true);
sysTableLookup.addLookupField(fieldNum(DimAttributeOMBusinessUnit,Value));
sysTableLookup.addLookupField(fieldNum(DimAttributeOMBusinessUnit,Name));
queryBuildDataSource = query.addDataSource(tableNum(DimAttributeOMBusinessUnit));
//queryBuildRange = queryBuildDataSource.addRange(fieldNum(DefaultDimensionView,Name));
//queryBuildRange.value('BusinessUnit');
sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
FormControlCancelableSuperEventArgs ce = e as FormControlCancelableSuperEventArgs;
//cancel super() to prevent error.
ce.CancelSuperCall();
}
[FormControlEventHandler(formControlStr(DTWorkerDimensionForm, DTWorkerDimTbl_DTBuisnessUnit), FormControlEventType::Lookup)]
public static void DTWorkerDimTbl_DTBuisnessUnit_OnLookup(FormControl sender, FormControlEventArgs e)
{
Name name = "BusinessUnit";
Query query = new Query();
QueryBuildDataSource qbdsDimensionFinancialTag = query.addDataSource(tableNum(DimensionFinancialTag));
QueryBuildRange qbrFinancialTagCategory = qbdsDimensionFinancialTag.addRange(fieldNum(DimensionFinancialTag, FinancialTagCategory));
qbrFinancialTagCategory.value(queryValue(DimensionAttribute::findByName(name).financialTagCategory()));
SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(DimensionFinancialTag), sender);
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;
ce.cancelSuperCall();
}
/// <summary>
///
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
[FormControlEventHandler(formControlStr(DTWorkerDimensionForm, DTWorkerDimTbl_DTBuisnessUnit), FormControlEventType::Lookup)]
public static void DTWorkerDimTbl_DTBuisnessUnit_OnLookup(FormControl sender, FormControlEventArgs e)
{
SysTableLookup sysTableLookup;
Query query;
QueryBuildDataSource qbdsDimensionFinancialTag;
QueryBuildRange qbrFinancialTagCategory;
String20 LC;
RecId _recid;
DimensionAttribute _attribute;
Name _name= "BusinessUnit";
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();
}
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,277 Super User 2024 Season 2
Martin Dráb 228,135 Most Valuable Professional
nmaenpaa 101,148