Hello,
1. I would like to add a lookup that shows a list of all the enum types.
2. I would like to add a enum, but show not only the enum values (i.e if the enum has 'A', 'B', 'C' values, want for to show 'A', 'B', without the 'C' when doing lookup on that enum).
Thanks :)
*This post is locked for comments
You can use the method
ControlName_LineType.delete((enum2Str(ABCEnumType::C)));
where ControlName_LineType is the Formcomboboxcontrol name where we find the Enum variable.
learn.microsoft.com/.../dynamics.ax.application.formcomboboxcontrol
learn.microsoft.com/.../dynamics.ax.application.formcomboboxcontrol.delete
Eitan Mizrahi,
Can you please explain little more ?
Additionally, you may have a look at following standard examples from AX AOT
Sohaib - Thank you.
Is there any similar solution for extended datatype (only string based).
Thanks :)
Hi Eitan,
you will definitely use the Sysdictclass object, but you'll fill the temporary table in order to give the lookup field a datasource.
Or
You can double check how the form DMFTargetXMLToEntityMap and look for the stringEdit: TargetXMLToEntityMapGroup_EntityField (method lookup). It's using a lookup method on UtilElements.
Hope this helps.
BR,
Luca Pellegrini
For your question number 1 here is the solution:
public void lookup()
{
Query sysModelElementQuery;
QueryBuildDataSource sysModelElementDataSource;
QueryBuildRange sysModelElementRange;
// create lookup table for SysModelElements and use the Name field
SysTableLookup lookupTable = SysTableLookup::newParameters(tableNum(SysModelElement), this);
lookupTable.addLookupfield(fieldNum(SysModelElement, Name));
lookupTable.setLabel("Base Enum Name");
// create a query used to filtering only the Base enumerations.
sysModelElementQuery = new Query();
sysModelElementDataSource = sysModelElementQuery.addDataSource(tableNum(SysModelElement));
sysModelElementRange = sysModelElementDataSource.addRange(fieldNum(SysModelElement, ElementType));
sysModelElementRange.status(RangeStatus::Hidden);
sysModelElementRange.value(SysQuery::value(enum2int(UtilElementType::Enum)));
lookupTable.parmQuery(sysModelElementQuery);
lookupTable.performFormLookup();
super();
}
You didn't understand me well - sorry.
1. All the list of enums is like you standing on menuitem object, and see the list of all enum, when standing on enumtypeParameter property.
2. I don't want using temporary table - just using a sysdictclass or something similar.
Thanks :)
Hi Eitan,
have you tried to create a temp table and fill it with your enum values (filtering them if needed) on the lookup method of your form control?
Hope this helps.
BR,
Luca Pellegrini
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,302 Most Valuable Professional
nmaenpaa 101,156