Thursday, October 31, 2019

Using a tempDB table in a Query

static void TempDB(Args _args)

{


    PurchLineMarkTmp    tmpUnionedResult;


    InventTable         inventTable;


    InventTableModule   inventTableModule;


    Query               query;


    QueryRun            queryRun;




    // Execute insert_recordset with TempDB table as a target


     insert_recordset tmpUnionedResult(PurchLine)


        select RecId from inventTable


            exists join inventTableModule


                where   inventTableModule.ModuleType == ModuleInventPurchSales::Sales


                    && inventTable.ItemId == inventTableModule.ItemId


                    && inventTableModule.Price != 0; 




    query = new query();


    query.addDataSource(tableNum(PurchLineMarkTmp));


    queryRun = new QueryRun(query);


    // Force queryRun to fetch from the right temporary table


    queryRun.setRecord(tmpUnionedResult);




    // Iterate all registered quantities


    while (queryRun.next())


    {


        tmpUnionedResult   = queryRun.get(tablenum(PurchLineMarkTmp));


        info (strFmt('%1', tmpUnionedResult.PurchLine));


    }


}




source: http://mafsarkhan.blogspot.com/2013/07/example-for-using-tempdb-table-in-query.html

Set up Onebox VM for D365 FO with non-organization microsoft account

With the release of the new VHD 10.0.37, I have tried to create a Onebox VM in my laptop instead of using the cloud hosted environment and f...