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

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

Multiselect lookup data is not updating

(0) ShareShare
ReportReport
Posted on by 75

I have added lookup method on StringEdit(InvoiceIdMultiselect) formcontrol as follows:

public void lookup()
{
    Query query = new Query();
    QueryBuildDataSource queryBuildDataSource;

    queryBuildDataSource = query.addDataSource(tableNum(VendInvoiceJour));
    queryBuildDataSource.addRange(fieldNum(VendInvoiceJour,PurchId)).value(PurchId.valueStr());

    queryBuildDataSource.addSelectionField(fieldNum(VendInvoiceJour, InvoiceId));
    queryBuildDataSource.addSelectionField(fieldNum(VendInvoiceJour, PurchId));

    msCtrl = SysLookupMultiSelectCtrl::constructWithQuery(this.formRun(), InvoiceIdMultiselect, query);

    //super();
}

On testing, when I am changing PO, lookup values are not updating,

Image

But when I am closing the form and reopening, it updates the data.

Any solution?

I have the same question (0)
  • Suggested answer
    Mohit Rampal Profile Picture
    12,563 Moderator on at
    RE: Multiselect lookup data is not updating

    Hi Ashraf, Have you checked this thread. Hope it helps.

    community.dynamics.com/.../reset-selection-from-syslookupmultiselectctrl-when-create-new-record-in-from-data-source

  • Ashraf_ahk Profile Picture
    75 on at
    RE: Multiselect lookup data is not updating

    Yes I have tried but did not work.

  • Suggested answer
    Vignesh.A Profile Picture
    203 on at
    RE: Multiselect lookup data is not updating

    Hi Ashraf,

    Override the modified method of your form control for which the lookup is crated and add the below code after super()

    this.text(con2str(msctrl.getSelectedFieldValues(), ';'));

    Note: your msctrl should be declared as global variable.

    You can refer the below post explaining the same for D365 FO

    dax365.blogspot.com/.../multi-select-lookup-in-d365-fo.html

  • Ashraf_ahk Profile Picture
    75 on at
    RE: Multiselect lookup data is not updating

    Resolved

    public void lookup()
    {
        //super();
        Query query = new Query();
        QueryBuildDataSource qbdsVendInvoiceJour, qbdsVendTrans;
    
        qbdsVendInvoiceJour = query.addDataSource(tableNum(VendInvoiceJour));
        qbdsVendTrans       = qbdsVendInvoiceJour.addDataSource(tableNum(VendTrans));
        qbdsVendTrans.relations(true);
    
        qbdsVendInvoiceJour.addSelectionField(fieldNum(VendInvoiceJour, InvoiceId));
        qbdsVendInvoiceJour.addSelectionField(fieldNum(VendInvoiceJour, PurchId));
        qbdsVendInvoiceJour.addSelectionField(fieldNum(VendInvoiceJour, DueDate));
        qbdsVendTrans.addSelectionField(fieldNum(VendTrans, Voucher));
        qbdsVendTrans.addSelectionField(fieldNum(VendTrans, TransDate));
        qbdsVendTrans.addSelectionField(fieldNum(VendTrans, PromissoryNoteStatus));
    
        qbdsVendInvoiceJour.addRange(fieldNum(VendInvoiceJour,PurchId)).value(PurchId.valueStr());
    
        msCtrl = SysLookupMultiSelectGrid::construct(this,this);
        msCtrl.parmQuery(query);
        msCtrl.run();
        //msCtrl = SysLookupMultiSelectCtrl::constructWithQuery(this.formRun(), this, query);
    
    }

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 734 Super User 2025 Season 2

#2
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 636

#3
Martin Dráb Profile Picture

Martin Dráb 553 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans