Announcements
I have created multi select lookup. It is working fine but when I select value it does not display value on form. below is my screen shot
here is my lookup code
public void lookup() { Query query = new Query(); QueryBuildDataSource queryBuildDataSource; QueryBuildRange queryBuildRange; SysTableLookup sysTableLookup; str ItemCategoryCodeforlockup = RNI_Product.valueStr(); if(ItemCategoryCodeforlockup) { queryBuildDataSource = query.addDataSource(tableNum(SL_ItemCatSubType)); queryBuildDataSource.addRange(fieldNum(SL_ItemCatSubType,RNI_LINEOFPRODDESCRIPTION)).value(ItemCategoryCodeforlockup); msCtrl = SysLookupMultiSelectCtrl::constructWithQuery(this.formRun(),this,query); } }
public boolean modified() { boolean ret; container c,v; int i; ret = super(); if (ret) { c = msCtrl.get(); // get RecIds of the selected rows v = msCtrl.getSelectedFieldValues(); // get actual value of the selected rows for (i = 1; i <= conLen(c);i ) { //info(conPeek(c,i)); //info(conPeek(v,i)); } } return ret; }
This statement should be in the init method of the form so that you can initialize the SysLookupMultiSelectCtrl instance with the name of the control.
msCtrl = SysLookupMultiSelectCtrl::constructWithQuery(this.formRun(),this,query);
How does this form work? Are these selected values stored in a different table?
It might be useful for you to look at a few examples of how these lookups can be achieved. Please check the following links -
AX 2012 - Multiselect Lookup - Microsoft Dynamics AX Community
I would like to thank you for responding on my question
No Gunjan, It does not display any value when I re-open form.
Note: I have also edit my question and add code in my question on your request
Hi Syed,
Is it an issue only when you select the values? If you close the form and re-open it, can you see the values fine?
It might be helpful if you share your code related to this multi-select lookup.
André Arnaud de Cal...
293,998
Super User 2025 Season 1
Martin Dráb
232,850
Most Valuable Professional
nmaenpaa
101,158
Moderator