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, ...
Suggested Answer

SSRS report multi select lookup based on temp table

(0) ShareShare
ReportReport
Posted on by 1,114
Hello,
 
I'm trying to create a multi lookup SSRS parameter and I have found an article explaining how to do that
 
 
it works like a charm when the lookup query is based on the regular table but I need it ti be based on the TEMPDB table and can't achieve this.
 
I tried this but with no result
 
 

Method: postRun

/// <summary>
/// Implements the functionality that is supposed to execute after run.
/// </summary>
public void postRun()
{
this.sampleTableIdLookup();
}

Method: sampleTableIdLookup

/// <summary>
/// Creates a SampleTable id lookup.
/// </summary>
public void sampleTableIdLookup()
{
 
TableTmp tableTmp;
 
tableTmp.id = 1;
tableTmp.insert();
 
tableTmp.id = 2;
tableTmp.insert();
 

Query query = new Query();
query.adddatasource(tablenum(tableTmp));
query.datasourcetable(tablenum(tableTmp)).addselectionfield(fieldnum(tableTmp,ID));
 
QueryRun qr = new QueryRun(query);
qr.setcursor(tableTmp);

TableId multiSelectTableNum = tableNum(tableTmp);
container selectedFields = [multiSelectTableNum, fieldName2id(multiSelectTableNum, fieldStr(tableTmp, Id))];
SysLookupMultiSelectCtrl::constructWithQueryRun(this.dialog().dialogForm().formRun(), idField.control(), qr, false, selectedFields);
}
 
Lookup on the parameter form stays empty. Maybe anyone did smth like that before? Any help will be much appreciated
 
Thank you.
I have the same question (0)
  • Suggested answer
    Layan Jwei Profile Picture
    8,165 Super User 2026 Season 1 on at
    Hi Dark knight,

    The link you provided is not working for me.

    you could follow the following links in general for multi select (check if they help)
    https://d365fotechnicalblog.blogspot.com/2022/06/create-multi-selection-lookup-in-d365fo_5.html?m=1
    https://community.dynamics.com/blogs/post/?postid=1c4642c9-19be-43aa-847a-b396252f90f6
    https://msdaxter.wordpress.com/2018/04/12/create-a-multiselect-lookup-control-on-a-form/

    but you will need this line of code as an additional thing:
    sysTableLookup.parmTmpBuffer(YoutTmpTable);

    Here's another link that shows how to parmTmpBuffer (but this one is not for multi select)
    https://robscode.onl/x-lookup-on-temp-table-on-form-control-2/

    I'm not sure if it's doable as i didn't try it, but try to combine the links and see if you could make it working

    Thanks,
    Layan Jweihan
    Please mark this answer as "Verified" if it solved your issue. In order to help others who will face a similar issue in the future
  • Suggested answer
    Layan Jwei Profile Picture
    8,165 Super User 2026 Season 1 on at
    Hi Dark knight,

    I also just saw a standard class that uses "SysLookupMultiSelectCtrl::constructWithQueryRun" and also uses a tmp table.
    This method "companyLookup" gets called from postRun method 

    So you can check this standard class and see if it helps


    Thanks,
    Layan Jweihan
    Please mark this answer as "Verified" if it solved your issue. In order to help others who will face a similar issue in the future
  • Hana Xue Profile Picture
    Microsoft Employee on at
    Hi,
    Your link opened abnormally, so we can't view it. You can check if the links below are useful.
    jonesd365.blogspot.com
    dynamicsgate.com
    Best Regards,
    Hana
  • dark_knight Profile Picture
    1,114 on at
    Hello,
     
    Thank you for your answers. Yes, I have checked multiple standard classes and they do exactly what I do. they fill up temp table. Then set cursor to temp table buffer but for me this doesn't work.
  • dark_knight Profile Picture
    1,114 on at
    Hello,
     
    Thank. I also pasted the code. I do exactly what is done in standard classes as you can see and this doesn't work. I fill up temptable, then set cursor to this tmp buffer. NO result. Lookup is empty.
  • Suggested answer
    Waed Ayyad Profile Picture
    9,074 Super User 2026 Season 1 on at
    Hi,
     
    Did you try to reset usage data (clear cache)?
     
    Thanks,
    Waed Ayyad.

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
André Arnaud de Calavon Profile Picture

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

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 470

#3
Adis Profile Picture

Adis 270 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans