Hello.
I have some problems.
I created a lookup method that shows DisplayValue and Name corresponding to Business Area.
I can see the DisplayValue, but I can't see the 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();
}
I developed it by referring to the source on the Internet.
Business Area | Name |
1000 | |
2000 | |
3000 | |
4000 |
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,902 Super User 2024 Season 2
Martin Dráb 229,297 Most Valuable Professional
nmaenpaa 101,156