When speaking about lookups, in most cases, we mean a list of data records presented to the user for selection. But sometimes, it is required to show a list of possible selection options that are "hardcoded" into the application or retrieved from an external system or file. Normally, it is a much smaller list of options as opposed to those of the data-driven lookups.
In this recipe, we will create such a lookup with a help of the global pickList()
function. We use a Dynamics AX job, which will create and run the lookup.
Create a new job called
PickList
:static void PickList(Args _args) { Map choices; str ret; ; choices = new Map( Types::Integer, Types::String); choices.insert(1, "Dynamics AX 2009"); choices.insert(2, "Dynamics AX 4.0"); ret = pickList(choices, "", "Choose version"); if (ret) { info(strfmt("You've selected option No. %1", ret)); }...