Reputation: 1369
I have been successfully using a custom lookup for years in AX2009. After uplifting to RU7, it seems the previous method no longer works. Any suggestions as to what I should change in order to fix it?
Here is the code I've been using to call custom lookups:
public void lookup()
{
List valueList = new List(Types::String);
;
//add the choices to the list
valueList.addEnd('@ABC123');
valueList.addEnd('@ABC246);
//display the list using the customized syslookup routine
SysLookup::lookupList(this, valueList, "@ABC369");
super();
}
Here is the method I added to the sysLookup class:
public static client void lookupList(FormStringControl _formStringControl, List _valueList, str _columnLabel = '')
{
Args args;
FormRun formRun;
;
if (_formStringControl && _valueList && _valueList.typeId() == Types::String)
{
args = new Args(formstr(SysLookup));
args.parmObject(_valueList);
args.parm(_columnLabel);
formRun = classFactory.formRunClass(args);
formRun.init();
_formStringControl.performFormLookup(formRun);
}
}
This worked perfectly until we installed RU7. Now, we receive the following error:
Error executing code: DictEnum object not initialized. (C)\Classes\DictEnum\label (C)\Forms\SysLookup\Methods\run (C)\Classes\FormStringControl\performFormLookup (C)\Classes\SysLookup\lookupList - line 16 (C)\Classes\FormStringControl\Lookup
I'm open to suggestions as to how to fix the current problem or how to create the same effect in RU7 (without bringing in the pre-RU7 syslookup class, which does work, but isn't acceptable.)
Upvotes: 0
Views: 1031
Reputation: 6686
I wonder what application version you could have been successfully using your custom lookup in.
It isn't working even in RU-3. I suppose your SysLookup
form had been customized so that you could use your lookupList
method - I suggest you to verify it.
Standard SysLookup form makes use only of args.parm() and not args.parmObject(), so your _valueList is not going to be used at all. You can check how the lookup form is called in \Forms\KMQuestionnaireStatistics\Designs\Design\[Tab:Tab]\[TabPage:RangesTab]\[Group:Ranges]\StringEdit:rangeGender\Methods\lookup
I don't know the value of your label "@ABC369"
, but in standard AX you won't have an error only if it this label holds some base enum's ID (e.g. "732" for NoYesCombo
). You can also check it, however your List won't be displayed in the lookup. You'd better check how the SysLookup
form had been customized in the environment where you've been successfully using the code snippet you provided.
Upvotes: 1