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

Notifications

Announcements

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 942
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
    Waed Ayyad Profile Picture
    9,047 Super User 2025 Season 2 on at
    Hi,
     
    Did you try to reset usage data (clear cache)?
     
    Thanks,
    Waed Ayyad.
  • dark_knight Profile Picture
    942 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.
  • dark_knight Profile Picture
    942 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.
  • 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
  • Suggested answer
    Layan Jwei Profile Picture
    8,158 Super User 2025 Season 2 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
  • Suggested answer
    Layan Jwei Profile Picture
    8,158 Super User 2025 Season 2 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

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

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

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

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 843 Super User 2025 Season 2

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 843 Super User 2025 Season 2

#3
André Arnaud de Calavon Profile Picture

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

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans