[X++] Lookup on temp table on form control

Let's assume there is a temporary table of type "InMemory" as a datasource on a form and you want to create a lookup on a control on the same form.

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);   

    // DataSource on form with populated data via .setTmpData():