Dear All,
I CREATED THIS PROCESS REPORT METHOD TO populate data on a temp table using select statement and then populate it to another temp table using query functions , but it can't populate my second temp table yet , would someone please help?
public void processReport() { ADVChecks AdvChk ; ADVCHKCheckStepsActual AdvChekStpActul ; SG_NotesReceivableTmp tmp ; TransDate NotesDate; ADVCHKStepID StepId ; ADVCHKStepType Steptype ; ADVCHKStepGroupID StepGroup ; ADVCheckGroupID CheckGroup ; ADVCHKStepSequence advseq ; // Query Query query; QueryRun qr; QueryBuildDataSource queryBuildDataSource , qbds , qbd; QueryBuildRange queryBuildRange , qbr; QueryFilter qf ; SG_NotesReceivableContract_Q Contract ; Contract = this.parmDataContract(); TmpDB.ADVCheckID while Select AdvChk // 'Check_11-000010759' { while select firstOnly AdvChekStpActul order by AdvChekStpActul.ADVCHKStepSequence desc where AdvChekStpActul.ADVCheckID == AdvChk.ADVCheckID && AdvChekStpActul.TransDate <= NotesDate && AdvChekStpActul.TransDate && AdvChekStpActul.Applied == 1 { TmpDB.CustAccount = AdvChk.CustAccount ; TmpDB.CustName = AdvChk.CustName ; TmpDB.AmountCur = AdvChk.AmountCur ; TmpDB.ADVNetAmount = AdvChk.ADVNetAmount ; TmpDB.ADVCheckSource = AdvChk.ADVCheckSource ; TmpDB.ADVCheckGroupID = AdvChk.ADVCheckGroupID ; TmpDB.ADVCHKStepType = AdvChekStpActul.ADVCHKStepType ; TmpDB.ADVCheckID = AdvChekStpActul.ADVCheckID ; TmpDB.Voucher = AdvChekStpActul.Voucher ; TmpDB.ADVCHKStepID = AdvChekStpActul.ADVCHKStepID ; TmpDB.TransDate = AdvChekStpActul.TransDate ; TmpDB.ADVCHKStepGroupID = AdvChekStpActul.ADVCHKStepGroupID ; TmpDB.ADVCHKStepSequence = AdvChekStpActul.ADVCHKStepSequence ; TmpDB.LedgerName = DimensionAttributeValueCombination::getDisplayValue(AdvChekStpActul.LedgerDimension); TmpDB.LedgerDimension = AdvChekStpActul.LedgerDimension ; TmpDB.insert() ; } } query = new Query(); queryBuildDataSource = query.addDataSource(tablenum(SG_NotesReceivableTmp)); qr = new QueryRun(query); qr.setRecord(tmp); while (qr.next()) { tmp = qr.get(tablenum(SG_NotesReceivableTmp)); TmpDB2.CustAccount = tmp.CustAccount ; TmpDB2.CustName = tmp.CustName ; TmpDB2.AmountCur = tmp.AmountCur ; TmpDB2.ADVNetAmount = tmp.ADVNetAmount ; TmpDB2.ADVCheckSource = tmp.ADVCheckSource ; TmpDB2.ADVCheckGroupID = tmp.ADVCheckGroupID ; TmpDB2.ADVCHKStepType = tmp.ADVCHKStepType ; TmpDB2.ADVCheckID = tmp.ADVCheckID ; TmpDB2.Voucher = TmpDB.Voucher ; TmpDB2.insert() ; } }