Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 72043

How to get values inserted in a tmp table from form?

$
0
0

I have a button inside form that does the following logic :

public TmpDBTable createTmDBTable()
    {
        Query                       query = new Query();
        QueryRun                    qr;
        Tabel1                      table1;
        RecordInsertList            recordInsertList;

        RecordInsertList = new RecordInsertList(tableNum(TmpDBTable), true, true, true, true, true, tmpDBTable);

        query.addDataSource(tablenum(Tabel1));

        fromDateTime = fromDateTime ? fromDateTime : DateTimeUtil::getSystemDateTime();

        this.buildQuery(query);  // logic for building the query
    
        qr = new QueryRun(query);
    
        delete_from tmpDBTable;

        while (qr.next())
        {
            table1 = qr.get(tablenum(Table1));


            tmpDBTable.clear();
            tmpDBTable.initFromTable1(table1);

    
            recordInsertList.add(tmpDBTable);    
        }

        recordInsertList.insertDatabase();


        return tmpDBTable;
    }

then the datasource_ds.executeQuery() is called.

How can i call this method from outside and get all records that got inserted inside the tmp table

I tried this but i got nothing:

class1 class1 = new class1();

TmpDBTable tmpDBTable1 = class1.createTmpDBTable();
while(tmpDBTable1)
{
}

Viewing all articles
Browse latest Browse all 72043

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>