web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)
Answered

How to save (and show again) selected values in Multi-Select Lookup for SSRS

(0) ShareShare
ReportReport
Posted on by 737

Hi All,

I need to create SSRS report where one of the parameter is a Multi-Select Lookup. I used this tutorial

https://community.dynamics.com/ax/b/dynamicsaxinsightbyanas/archive/2014/12/12/ax-2012-multi-select-lookup-for-ssrs-report-dialog.aspx

the problem is: when I gonna choose the values in my multiselect lookup, it displays a grid, where just only the first row is marked as selected (but not the ones that I have selected in the previous step). I mean: if I want to make any selection, I click the button of lookup, chose, let’s say: first, second and fourth row, than I unclick the button (and the first, second and fourth values are displayed in my control, which is good), but if click the button of lookup one’s again, I will see just that the first row is marked as selected (but not the first, second and fourth).

Could you please help me on this?!

Thank you

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Ragoza Oleksandr Profile Picture
    737 on at

    To whom it will be interesting.

    Thanks to help of my colleague, the problem was solved in the following manner:

    In SysLookupMultiSelectGrid two methods has been created:

    public container newParmSelectId(container _selectedId = selectedId)

    {

       selectedId = _selectedId;

       return selectedId;

    }

    And

    public static void newlookup(Query _query,

       FormStringControl _ctrlIds,

       FormStringControl _ctrlStrs,

       container _selectField,

       queryRun _queryRun = null)

    {

       SysLookupMultiSelectGrid    lookupMS = new SysLookupMultiSelectGrid();

       lookupMS.parmCallingControlId(_ctrlIds);

       lookupMS.parmCallingControlStr(_ctrlStrs);

       lookupMS.parmQuery(_query);

       lookupMS.parmQueryRun(_queryRun);

       lookupMS.parmSelectField(_selectField);

       lookupMS.pclParmSelectId(conNull());//this is the new line, which is absent in the original lookup method

       lookupMS.run();

    }

    So, the code in the overridden method in UIBuilder class is the following

    public void myLookup(formstringcontrol    _control)

    {

       query query = new query(querystr(myQuery));

       container   cnt;

       ;

       SysLookupMultiSelectGrid::newlookup (q, _control, _control, cnt);

    }

  • Ragoza Oleksandr Profile Picture
    737 on at

    Updated

    public void myLookup(FormStringControl    _control)

    {

       Query                   q;

       QueryBuildDataSource    qbds;

       container               cnt;

       cnt = conIns(cnt, 1, tableNum(MyTable));

       cnt = conIns(cnt, 2, fieldNum(MyTable, myFieldForLookup));

       if(_control != null)

       {

           q = new Query();

           qbds = q.addDataSource(tableNum(MyTable));

           qbds.addSelectionField(fieldNum(MyTable, myFieldForLookup));

           SysLookupMultiSelectGrid::newlookup(q, _control, _control, cnt);

       }

    }

  • Community Member Profile Picture
    on at

    Thanks Ragoza Oleksandr for sharing solution.

    It resolved my problem

  • Community Member Profile Picture
    on at

    What is lookupMS.pclParmSelectId ?? whats in this method? 

  • Community Member Profile Picture
    on at

    Why you want to change the original class? Should we be extending the class called CustSysLookMultiSelectGrid and implement the new method newLookup?

  • Vakula Profile Picture
    15 on at

     cnt = conIns(cnt, 1, tableNum(MyTable));

      cnt = conIns(cnt, 2, fieldNum(MyTable, myFieldForLookup));

    The above lines of code did not work. Any changes to that please help me out

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Sanhthosh.Kumar.K Profile Picture

Sanhthosh.Kumar.K 2

#2
Raed Salah Bzour Profile Picture

Raed Salah Bzour 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans