...public Object dialog(){DialogRunbase dialog = super();dlgItemId = dialog.addField(extendedTypeStr(ItemId));dlgItemId.registerOverrideMethod(methodStr(FormStringControl, lookup), methodStr(MyRunBaseClass, itemIdLookup), this);dlgItemId.registerOverrideMethod(methodStr(FormStringControl, resolveAmbiguousReference), methodStr(MyRunBaseClass, itemIdResolveAmbiguousReference), this);return dialog;}public str itemIdResolveAmbiguousReference(FormStringControl _control) { return FormControlAmbiguousReferenceResolver::resolveAmbiguousReferenceForControl( _control, true, AbsoluteFieldBinding::construct(fieldStr(InventTable, ItemId), tableStr(InventTable)), AbsoluteFieldBinding::construct(fieldStr(InventTable, NameAlias), tableStr(InventTable))); } public void itemIdLookup(FormStringControl _control) { new InventLookup(_control, new Query(), formStr(MyInventItemIdLookup)).run(); }...
[Form]public class MyInventItemIdLookup extends FormRun{public void init(){super();element.selectMode(InventTableExpanded_ItemId);}public void run(){FormStringControl callerControl = SysTableLookup::getCallerStringControl(element.args());boolean filterLookup = false;filterLookup = SysTableLookup::filterLookupPreRun(callerControl,InventTableExpanded_ItemId,InventTableExpanded_DS);super();SysTableLookup::filterLookupPostRun(filterLookup,callerControl.text(),InventTableExpanded_ItemId,InventTableExpanded_DS,new FormControlAmbiguousReferenceResolver(callerControl,AbsoluteFieldBinding::construct(fieldStr(InventTableExpanded, ItemId),tableStr(InventTableExpanded)),AbsoluteFieldBinding::construct(fieldStr(InventTableExpanded, NameAlias),tableStr(InventTableExpanded))),InventTableExpanded_NameAlias,true);}}
DaxOnline.org is free platform that allows you to quickly store and reuse snippets, notes, articles related to Dynamics AX.
Authors are allowed to set their own AdSense units and "buy me a coffee" link.
Join us.