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, ...
Answered

Tmp table is empty when performing lookup

(1) ShareShare
ReportReport
Posted on by 513
I wanted the user to choose a table and then I show all fields in that table in a lookup...
 
 
so I created a Tmp table with one string field and this method to load the values -columns names- into the Tmp table:
 private void loadTableFields()
    {
        DYNADDVFieldTableTmp  dYNADDVFieldTableTmpRecord;
        DictTable             dictTable;
        fieldId               fieldId;

        switch(Grid_TableOption.selection())
        {
            case DYNADDVTableOption::SalesTable:
                dictTable  = new DictTable(tableNum(SalesTable));
                fieldId    = dictTable.fieldNext(0);
                break;

            default:
                FieldComboBox.clear();
                break;
        }
        
        while (fieldId)
        {
            dYNADDVFieldTableTmpRecord.clear();
            dYNADDVFieldTableTmpRecord.Field = dictTable.fieldObject(fieldId).name();
            dYNADDVFieldTableTmpRecord.insert();

            fieldId = dictTable.fieldNext(fieldId);
        }

        element.redraw();
    }
 
 
I override the "Table" field lookup method:
public void lookup(FormControl _formControl, str _filterStr)
    {
         SysTableLookup loopUpTable = SysTableLookup::newParameters(tableNum(DYNADDVFieldTableTmp),_formControl);
         Query                               q;
         QueryBuildDataSource                qbds;

         q           = new Query();
         qbds        = q.addDataSource(tableNum(DYNADDVFieldTableTmp));
              
         loopUpTable.addLookupField(fieldNum(DYNADDVFieldTableTmp, Field));

         loopUpTable.parmQuery(q);
         loopUpTable.performFormLookup();
         element.redraw();
         _formControl.update();
     }
but this is the result I get.. the lookup is empty!
 
I have the same question (0)
  • Verified answer
    Waed Ayyad Profile Picture
    9,089 Super User 2026 Season 1 on at
    Hi,
     
    You should Add:
    loopUpTable.parmTmpBuffer(_yourTemp);
     
    loopUpTable.parmQuery(q);
    loopUpTable.parmTmpBuffer(DYNADDVFieldTableTmp);
    loopUpTable.performFormLookup();
     
    Thanks,
    Waed Ayyad
    If this helped, please mark it as "Verified" for others facing the same issue
     

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!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

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

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 663

#2
André Arnaud de Calavon Profile Picture

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

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 337 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans