Lookup using temporary table

I`m trying to create a custom lookup by building a temporary table and then show the result.

I able to do it with a normal table , but not a temp table.

Is it possible or not?

Thanks

ttsbegin;

BER_tmpDisplayComboLookup.itemid = ‘aa bas’;

BER_tmpDisplayComboLookup.qtyDestination = 1234;

BER_tmpDisplayComboLookup.qtySource = 1111;

BER_tmpDisplayComboLookup.insert();

ttscommit;

qbdsBER_tmpDisplayComboLookup = query.addDataSource(tableNum(BER_tmpDisplayComboLookup));

sysTableLookup = SysMultiTableLookup::newParameters(this, query);

sysTableLookup.addLookupfield(fieldnum(BER_tmpDisplayComboLookup, itemid),1,true);

sysTableLookup.performFormLookup();

Try by removing the transaction scope, they won’t have an effect in case of in memory tables.

Even if I remove the ttsbegin and ttscommit … nothing showup in lookup :frowning:

Am doubting on the above class object - sysTableLookup & SysMultiTableLookup ? Are these two different classes?

When using SysTableLookup, you have to pass the temporary buffer to SysTableLookup.parmTmpBuffer(). You wouldn’t have to wait for this answer here because you can easily find it by a search engine.

I expect that SysMultiTableLookup supports it in the same way, but I’m leaving testing to you.