I hope you are all doing well.
{
next init();
FormRun forecastSalesForm;
ForecastSales forecastSalesLocal;
FT_ItemForecastProductionTableTmp itemForecastProductionTableTmp;
FT_ItemForecastProductionTableTmp itemForecastProductionTableTmpLocal;
forecastSales_ds,
itemForecastProductionTableTmp_ds;
ProdTable prodTable;
Args prodTableCreateFormArgs = prodTableCreateForm.args();
itemForecastProductionTableTmp = itemForecastProductionTableTmp_ds.cursor();
prodTable = prodTableCreate_ProdTable_ds.cursor();
if(prodTableCreateFormArgs.callerName() == formStr(ForecastSales))
{
forecastSalesForm = prodTableCreateFormArgs.caller();
forecastSales_ds = forecastSalesForm.dataSource(formDataSourceStr(ForecastSales, ForecastSales));
forecastSalesLocal = forecastSales_ds.getFirst(true);
if(!forecastSalesLocal)
forecastSalesLocal = forecastSales_ds.cursor();
while(forecastSalesLocal)
{
itemForecastProductionTableTmpLocal.clear();
itemForecastProductionTableTmpLocal.ProdId = prodTable.ProdId;
itemForecastProductionTableTmpLocal.ProjId = forecastSalesLocal.ProjId;
itemForecastProductionTableTmpLocal.ItemId = forecastSalesLocal.ItemId;
itemForecastProductionTableTmpLocal.InventDimId = forecastSalesLocal.inventDimId;
itemForecastProductionTableTmpLocal.ForecastSalesReservedQty = forecastSalesLocal.displayRemianingProdQuantity();
itemForecastProductionTableTmpLocal.ForecastEntryNumber = forecastSalesLocal.ForecastEntryNumber;
itemForecastProductionTableTmpLocal.insert();
forecastSalesLocal = forecastSales_ds.getNext();
}
itemForecastProductionTableTmp.linkPhysicalTableInstance(itemForecastProductionTableTmpLocal);
}
}
I have an extension on a form and i added a tempdb datasource,
In init method of the form i need to fill that temp datasource with the currently selected records from the previous form.
The problem is that i find only that last selected record is retrieved other don't, despite in the debugging i found that all selected records is inserted.
Could you tell me what is the problem

Report
All responses (
Answers (