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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Forums / Finance forum / Modify row selection i...
Finance forum

Modify row selection in lookup

(0) ShareShare
ReportReport
Posted on by 1,244

Hi,

I have a multi-select lookup on a string control. I want to select rows in the lookup based on the values given in the string control separated by comma or semicolon.

Could you please suggest how to do it?

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    303,718 Super User 2026 Season 1 on at

    Hi Abhinay,

    Can you explain your question? Possibly with a screenshot? Or are you looking for something similar to selecting address books per party?

  • Abhinay Tharwal Profile Picture
    1,244 on at

    Hi André,

    [quote user="André Arnaud de Calavon"]Or are you looking for something similar to selecting address books per party?[/quote]

    That is correct, similar to the roles stored in DirPartyLocationRole, I will have an editable text box with multiple values, and when the user would hit the lookup the rows with the provided values would be selected already, in addition to that the user might add a few more rows.

    Regards,

    Abhinay

  • nmaenpaa Profile Picture
    101,166 Moderator on at

    If you want to implement something that works in the same way as an existing lookup in the system, you can simply look how it's implemented.

  • Suggested answer
    André Arnaud de Calavon Profile Picture
    303,718 Super User 2026 Season 1 on at

    Hi Abhinay,

    You can indeed look at the examples present in the application itself. There is also a blog available with detailed steps: community.dynamics.com/.../using-multi-select-lookup-control-in-microsoft-dynamics-ax-2012

  • Abhinay Tharwal Profile Picture
    1,244 on at

    Hi André,

    Thank you for the link for reference! I have the multi-select working. But my requirement is a bit different.

    Maybe I will tweak the requirement a bit to make it more understandable (I wish I could post a screenshot)

    TextBox1 = Take values separated by commas or semi-colons from the user,

    TextBox2 (multi-select capable lookup) = based on the values given in the TextBox1 control, mark records in the lookup.

    Regards,

    Abhinay

  • Verified answer
    Abhinay Tharwal Profile Picture
    1,244 on at

    [quote user="Abhinay Tharwal"]TextBox1 = Take values separated by commas or semi-colons from the user,[/quote]

    This link has the solution I was looking for:

    public container SSI_createContainers()
    {
    List            list = new List(Types::String);
    ListIterator    i;
        container       RecIds, Names;
    RecId           id;
    
    //Create Container for the RecIds, Names
    list = Global::strSplit(SalesParameters.SSI_MainAccountId,”;”);
    
    i = new ListIterator(list);
    while(i.more())
    {
    id = MainAccount::findByMainAccountId(i.value()).RecId;
    RecIds += id;
    Names += i.value();
    i.next();
    }
    
    return [RecIds, Names];
    
    }

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Finance

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans