Had a little time now to create a job to test the Query, and the job returns data from the Query in all the tables, so the Query should work. static void RSH_TestQuery2(Args _args) { PriceDiscTable priceDiscTable; InventTable inventTable; InventTxt inventTxt; SalesLine salesLine; QueryRun queryRun; ; // Executing our query. queryRun = new QueryRun(queryStr(GJSOPriceDiscTable));//add any name of query here info(queryRun.query().dataSourceNo(1).toString()); info(queryRun.query().dataSourceNo(2).toString()); info(queryRun.query().dataSourceNo(3).toString()); info(queryRun.query().dataSourceNo(4).toString()); // Looping through query results. while (queryRun.next()) { // Assinging query results to table buffer. priceDiscTable = queryRun.get(tableName2Id('PriceDiscTable')); inventTable = queryRun.get(tableName2Id('InventTable')); inventTxt = queryRun.get(tableName2Id('InventTxt')); salesLine = queryRun.get(tableName2Id('SalesLine')); // Showing results. info( strFmt ('%1 - %2 - %3 - %4' , priceDiscTable.AccountRelation, priceDiscTable.Amount, priceDiscTable.ItemRelation, priceDiscTable.UnitId)); info( strFmt ('%1 - %2 - %3 - %4' , inventTable.itemName)); info( strFmt ('%1 - %2 - %3 - %4' , inventTxt.Txt)); info( strFmt ('%1 - %2 - %3 - %4' , salesLine.TaxItemGroup, salesLine.PriceUnit)); } } So why is the view not working?
↧