Multi-select ComboBox In AX 2009

Hi all ,

I have to create a form with two fields.One field is Combox and another one is Button.

The combobox should be multi -selected and the selected values should be displayed after clicking the button.

Pls tell me the possibilities…

Tables is Custtable and the field is Accountnum.

Thanks in Advance…

Use a table instead of the combobox. You can select multiple records in a grid and process them in the object called by the button.

Thanks for reply Martin.But I should use dropdown and display the selected values.

You need to use account number lookup.
Do you have a data source for this form? tell us more details.

Thanks for reply Kranthi.

In simple words ,In AX 2009, I have to create an enum with 5 values.In form control ,I should able to select more than one enum value.Thats it.

vermaax.wordpress.com/…/

Follow this this link as it is

and when u click the button inside override the Click() and get the all value by container then separate the values then u may show in form or report that ur wish.

Thanks casper.I have already seen this.It is for stringedit control.But I have to use enum and combobox control…
Tell me the possibilities…

It may not be a possible scenario, what is your end goal?

Thanks for reply kranthi ,

They said it is possible.And i should use enumfield and it should be multiselectable.

It is possible, if you put those enum elements to a temporary table. Then you can use all techniques for tables.

Thanks For Reply Martin ,

Can you share any link for this scenario.Its still confusing…

My favorite search engine found this example: [X++] SysLookupMultiSelectCtrl with temporary table. My keywords were ax temporary table lookup enum.

Thanks Martin ,

I have to implement this in ax 2009 .The above link is for AX 2012.

You may not multi select an enum field. We can only think about the alternatives, if there is a proper end goal.

Yes, it was written for AX 2012, but enums, temporary tables etc. exist in AX 2009 as well.
You complained that you have an enum, not a string field with a lookup, so you can’t use Caspar’s solution. So I told you to put those enum elements to a temporary table. You asked for a link, so I gave you link where you can see it.

Thanks for reply Martin ,

msCtrl = SysLookupMultiSelectCtrl::constructWithQueryRun(element, MultiSelect, qrEnumValues);

I got error for this line.

Error executing code: SysLookupMultiSelectCtrl (object) has no valid runable code in method ‘init’.

Tell me the solution…

My coding is ,
super();
//Initialize splitter
// splitter = new SysFormSplitter_X(GrpSplitter, GridContainer, element);
// Populate the data to the temporary table
EnumTemp.setTmpData(element.fillEnumTemp());
qrEnumValues = new QueryRun(queryStr(EnumTemp));
qrEnumValues.setCursor(EnumTemp);
// MultiSelect= StringEdit Control

msCtrl = SysLookupMultiSelectCtrl::constructWithQueryRun(element, MultiSelect, qrEnumValues);

You said that you can’t use Caspar’s suggestion, because “it is for stringedit control” but you “have to use enum and combobox control”. Now you know how to turn the enum to a temporary table, so you can use Caspar solution.
I didn’t meant you should use SysLookupMultiSelectCtrl instead; that wasn’t the topic.

You can’t expect blog posts covering exactly your scenario in exactly your version. I used this example when you asked for a link regarding how to “put enum elements to a temporary table”. It doesn’t mean that you can copy and paste everything without thinking.

So again, follow the blog post to put values of your enum to a temporary table. Then you can use the Caspar’s suggesting using a lookup with ReplaceOnLookup (the blog post I linked also shows how to put temporary tables to lookups), you can use a grid with multiselection (as suggested in the first reply), a grid with tickboxes for selected values or any other solution based on tables, because you now know how to resolve the limitation of using an enum by converting it to a table.

Can any one explain how to do this Ax 2009 ?

Thanks for Reply Martin ,

Sorry for the in convenience.I have added the enum values to the tempt able and Created Lookup method in my control.
It’s Working…

The Idea is not Clear Gopinath Can you please explain it