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 :
Finance | Project Operations, Human Resources, ...
Answered

How to solve this, when open multiselectlookup in second time, firsttime marked values are not selected

(0) ShareShare
ReportReport
Posted on by

Hi,

I using this query,

public void lookup()
        {
            SysLookupMultiSelectCtrl        msCtrlCust;
            QueryBuildDataSource            qbds;
            super();

            Query                       query   = new Query();
            qbds                                = query.addDataSource(tableNum(DataArea));

            qbds.fields().addField(fieldNum(DataArea,id));
            qbds.fields().addField(fieldNum(DataArea,Name));
            msCtrlCust.
            msCtrlCust = SysLookupMultiSelectCtrl::constructWithQuery(element, MultiLookup, query);

        }

When I open the multi-select lookup in the second time, First time selected(preselected) or marked values are not selected.

 I need this option. Eg; the first time I selected 2 records in the lookup, again I need to select one more record, So I clicked the lookup in the second time  But now  I previously selected records are not selected in the lookup. So unfortunately I again selected 3 records in the lookup

Thanks.

I have the same question (0)
  • Verified answer
    Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Ashok,

    Please try this code. It should work fine

    public void lookup()
    {
    	QueryBuildDataSource        qbds;			
    	container 					selectFields = conNull();
    	Query                       query   = new Query();
    	
    	qbds = query.addDataSource(tableNum(CompanyInfo));
    
        qbds.addSelectionField(fieldNum(CompanyInfo,DataArea));
        qbds.addSelectionField(fieldNum(CompanyInfo,Name));
    	
    	SysLookupMultiSelectCtrl::constructWithQuery(element, MultiLookup, query, false, selectedFields);
    }

  • Community Member Profile Picture
    on at

    Hi, Gunjan Bhattacharyya

    Thanks for this.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 617

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 461 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 298 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans