Hello,
I have a batch class which is scheduled to be run at a particular time.
There is a bellow following piece of code inside:
while (qr.next()) { salesTable = qr.get(tableNum(SalesTable)); setPrefix(salesTable.SalesId); if (this.process_check(onlyCustStorageFactor)) { salesResrveForMultiThread = new SalesResrveForMultiThread(); salesResrveForMultiThread.parmsalestable(salesTable); salesResrveForMultiThread.pack(); this.batchHeader().addRuntimeTask(salesResrveForMultiThread, this.parmCurrentBatch().RecId, BatchConstraintType::And); salesResrveForMultiThread = null; //salesResrveForMultiThread.run(); i ; } n ; }
Parameter salestbale isn't passed to the class SalesReserveForMultiThread. It gets null value and then gives me an error of course.
When I launch it manually and do not create runtimetasks parameter is passed correctly like that:
while (qr.next()) { salesTable = qr.get(tableNum(SalesTable)); setPrefix(salesTable.SalesId); if (this.process_check(onlyCustStorageFactor)) { salesResrveForMultiThread = new SalesResrveForMultiThread(); salesResrveForMultiThread.parmsalestable(salesTable); salesResrveForMultiThread.pack(); /*this.batchHeader().addRuntimeTask(salesResrveForMultiThread, this.parmCurrentBatch().RecId, BatchConstraintType::And); salesResrveForMultiThread = null;*/ salesResrveForMultiThread.run(); i ; } n ; }
So it seems like the problem is something to do with the runtimetasks. They are created correctly but inside them I get an error that salestable buffer is null. SalesTable records are extracted correctly because I get inside the loop. Can you help me please?