TempDB Table in form - multiple linking physical instance problem

Hello,

i have this code there i try to init table data on checkbox clicked method multiple times but i get an : Cannot execute the required database operation.
The method is only applicable to TempDB table variables that are not linked to existing physical table instance error

how to solve it that i could link if after checkbox clicked method there i fill the data into the temporary table ? 

public void INSfillCostCentersListPageTmp()
{
LedgerTrialBalanceListPageTmp ledgerTrialBalanceListPageTmp;
QueryBuildDataSource qbds;
Common common;
str 60 dimensionValue;
INSAccountCenters1 iNSAccountCenters1Table;
INSAccountCenters2 iNSAccountCenters2Table;
INSAccountCenters3 iNSAccountCenters3Table;

delete_from iNSCostCentersListPageTmpTable;

if(INSAccountCenters1.value())
{
while select * from iNSAccountCenters1Table
{
iNSCostCentersListPageTmpTable.clear();
iNSCostCentersListPageTmpTable.DisplayValue = iNSAccountCenters1Table.Value;

select sum(AmountCredit), sum(AmountDebit) from LedgerTrialBalanceTmp where LedgerTrialBalanceTmp.DimensionValues[2] == iNSAccountCenters1Table.Value && LedgerTrialBalanceTmp.DimensionValues[1] == iNSAccountCenters1Table.MainAccountId;

iNSCostCentersListPageTmpTable.SalesTotal = LedgerTrialBalanceTmp.AmountCredit - LedgerTrialBalanceTmp.AmountDebit;

total = total + iNSCostCentersListPageTmpTable.SalesTotal;

iNSCostCentersListPageTmpTable.insert();
}
}

INSCostCentersListPageTmp.linkPhysicalTableInstance(iNSCostCentersListPageTmpTable); // INS Raimondas - INS_SalesFigures_52673 8/23/2018
INSCostCentersListPageTmp_DS.research();
}

this is the init method 

public void init()
{
super();

INSCostCentersListPageTmp.setTmpData(iNSCostCentersListPageTmpTable); // INS Raimondas - INS_SalesFigures_52673 8/23/2018

INSCostCentersListPageTmp.linkPhysicalTableInstance(iNSCostCentersListPageTmpTable); // INS Raimondas - INS_SalesFigures_52673 8/23/2018

}

Parents
No Data
Reply Children
No Data
Related
Recommended