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 :
Dynamics 365 Community / Forums / Finance forum / Multi select lookup in...
Finance forum

Multi select lookup in Form Control using Temp table

(0) ShareShare
ReportReport
Posted on by 215

Hi,

Good evening!!!

Am trying to create a lookup in form control overwrite method. 

I used SysLookupMultiSelectCtrl::constructWithQuery() to get the multi select in lookup. It is working fine if it is regular type table

Incase of Tmp Table it shows empty record in lookup. 

Is it possible to create multi select lookup using temp table.

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    306,672 Super User 2026 Season 2 on at

    Hi Kathiravan,

    What is the exact scenario that you need a temporary table? Did you add coding to fill the temp table on this lookup?

  • Suggested answer
    Kathiravan Profile Picture
    215 on at

    Hi André Arnaud de Calavon,

    Sorry for the late response....

    Actually I already inserted records in Temp table (InMemory). I need to show that records as a lookup in form control (Form without Datasource).

    I had done that using SysLookupMultiSelectCtrl::constructWithQueryRun(element,ControlName,queryrun,true).

  • Suggested answer
    Rustem Galiamov Profile Picture
    8,072 on at

    Hi Kathiravan!

    Did you call parmTmpBuffer() method ?

    Ex.: sysTableLookup.parmTmpBuffer(yourTmpTable);

  • Kathiravan Profile Picture
    215 on at

    Hi Rustem Galiamov,

    No, I didn't call parmTmpBuffer() method.

    I passed the query in query run and called "queryrun.setcursor(TmpTable)" method.

  • Suggested answer
    Rustem Galiamov Profile Picture
    8,072 on at

    Hi Kathiravan!

    Did you tried to call this method ?

    For example:

    public void lookup()
    {
        SysTableLookup sysTableLookup = SysTableLookup::newParameters(tablenum(TmpTableFieldLookup), this);
        Query query = new Query();
        QueryBuildDataSource queryBuildDataSource;
    
        queryBuildDataSource = query.addDataSource(tablenum(TmpTableFieldLookup));
    
        sysTableLookup.addLookupfield(fieldnum(TmpTableFieldLookup, TableName), true);
    
        sysTableLookup.parmQuery(query);
        sysTableLookup.parmTmpBuffer(TmpTableFieldLookup);
        sysTableLookup.performFormLookup();
    }


  • Kathiravan Profile Picture
    215 on at

    Hi Rustem Galiamov;

    I tried like this but its not working. I did the lookup with the method (SysLookupMultiSelectCtrl::constructWithQueryRun(element,ControlName,queryrun,true))

    which I mention in my previous post and now working fine.

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