I was trying to insert data using while loop in my new table but it is not getting next line , when i use debugger i shows previous line in line number but i am inserting new line it should show line no 2 but it shoes line 1 in debugger. here is my code below.
internal final class DTCustomerNonPostedInV
{
void NonPostedInv()
{
CustInvoiceTable custInvoiceTable;
DTInvoicesLineTmp dtInvoicesLineTmp;
TaxRuntimeDocComponent taxRuntimeDocComponent;
taxDocumentRowTransaction_IN taxDocumentRowTransaction_IN;
taxDocumentRowTransaction taxDocumentRowTransaction;
CustInvoiceLine custInvoiceLine;
TaxDocumentComponentTransaction taxDocumentComponentTransaction;
TaxRuntimeLookup taxRuntimeLookup;
CustInvoiceJour custInvoiceJour;
TaxTrans taxTrans;
CustInvoiceTrans custInvoiceTrans;
TaxTable taxTable;
TaxComponentTable_IN taxComponentTable_IN;
TaxAmountCur sSgst,sIGST,sCGST;
InvoiceId invoiceId;
//ParentRecId1 parentId;
LogisticsPostalAddress logisticsPostalAddress;
InventLocationId inventLocationId;
TransTaxInformation transTaxInformation;
CustTable custTable;
LogisticsAddressStateId companyLocation,customerlocation;
real GSTRate = 0;
HSNCodeTable_IN hsntable_IN;
ttsbegin;
delete_from dtInvoicesLineTmp ;
ttscommit;
while select * from custInvoiceTable
where
custInvoiceTable.Posted == NOYES::No
//&& custInvoiceTable.InvoiceId == invoiceId
join custInvoiceLine
where custInvoiceLine.ParentRecId == custinvoicetable.RecId
{
ttsbegin;
dtInvoicesLineTmp.CustomerAccount = custInvoiceTable.OrderAccount;
dtInvoicesLineTmp.Name = custInvoiceTable.Name;
dtInvoicesLineTmp.InvoiceId = custInvoiceTable.InvoiceId;
dtInvoicesLineTmp.LineNum = custInvoiceline.LineNum;
dtInvoicesLineTmp.MainAccount = custInvoiceline.LedgerDimension;
dtInvoicesLineTmp.Quantity = custInvoiceline.Quantity;
dtInvoicesLineTmp.AmountCur = custInvoiceline.AmountCur;
dtInvoicesLineTmp.DTChargeCode = custInvoiceline.DTChargeCode;
dtInvoicesLineTmp.DTInvoiceId = custInvoiceline.DTInvoiceId;
dtInvoicesLineTmp.DTItemId = custInvoiceline.DTItemId;
dtInvoicesLineTmp.DTInvoicedate = custInvoiceline.DTInvoicedate;
dtInvoicesLineTmp.DTSchemeCharge = custInvoiceline.DTSchemeCharge;
dtInvoicesLineTmp.DTInventLocationId = custInvoiceline.DTInventLocationId;
dtInvoicesLineTmp.DTInventSiteId = custInvoiceline.DTInventSiteId;
dtInvoicesLineTmp.insert();
ttscommit;;
}
}
}