Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Multiselect lookup data is not updating

(0) ShareShare
ReportReport
Posted on by 75

I have added multiselect 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,

pastedimage1678953583194v1.png

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

Any solution?

  • 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);
    
    }

  • Guruprasanna Profile Picture
    1,054 on at
    RE: Multiselect lookup data is not updating

    When you select the new record try to refresh the data source. like dataSource_DS.refresh(); this might help you.

    Regards

    Guru

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,125 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,871 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans