Dear All,
I hope I am asking the question in the right Forum.
I have 2 TempDB tables
CBLTblSchedDataSaleTmp CBLTblSchedDataSale;
CBLTblSchedDataTemp _CBLTblSchedDataTemp;
I have inserted some data in _CBLTblSchedDataTemp and I want to use the data, apply some query and write data to another TempDB, CBLTblSchedDataSale. Extract from my code is as follows
[SrsReportDataSetAttribute(tableStr(CBLTblSchedDataSaleTmp))]
public CBLTblSchedDataSaleTmp Get_CBLTblSchedDataSaleTmp()
{
select CBLTblSchedDataSale;
return CBLTblSchedDataSale;
}
[SrsReportDataSetAttribute(tableStr(CBLTblSchedDataTemp))]
public CBLTblSchedDataTemp Get_CBLTblSchedDataTemp()
{
select _CBLTblSchedDataTemp;
return _CBLTblSchedDataTemp;
}
public void processReport()
{
_Contract=this.parmDataContract() as CBLClsSchedDataContract;
_PRODID=_Contract.prodID();
while
select sum(QtyOrdered), SLD_SALESORDER
from _CBLTblSchedDataTemp
group by SLD_SALESORDER
join _InventDim
where _salesLine.InventDimId==_InventDim.inventDimId
join SizeId, DropId
from _SizeChart
group by SizeId,DropID
where _SizeChart.InventSizeId==_InventDim.InventSizeId
join _ItemData
where _ItemData.ItemId==_salesLine.ItemId
&& _SizeChart.SizeChartId==_ItemData.SizeChartId
{
CBLTblSchedDataSale.SLD_SALESORDER=_CBLTblSchedDataTemp.SLD_SALESORDER;
CBLTblSchedDataSale.QtyOrdered=_CBLTblSchedDataTemp.QtyOrdered;
CBLTblSchedDataSale.SizeID=_CBLTblSchedDataTemp.SizeID;
CBLTblSchedDataSale.DropID=_CBLTblSchedDataTemp.DropID;
CBLTblSchedDataSale.insert();
}
}
The highlighted part is skipped after reading the While Select statement. Help Required
Hi Tayyab,
As mentioned above, there would be no data retrieved based on all the joins and where-clauses. You can use the debugger to check which parameters or variables don't have the correct value to retrieve the data, or like Mohit mentioned try the query in SQL first.
Hey Tayyab,
As i understand from "The highlighted part is skipped after reading the While Select statement." you mean your while select statement is empty. I cant see where you filled your _CBLTblSchedDataTemp table. If you are using temp table and filling them another code or scope they are referencing totaly diffrent datas. Make sure you pass filled temp table to data provider class.
Maybe this one helps your problem : learn.microsoft.com/.../temporary-tempdb-tables
Hi, If I understood correctly, the code in while select condition does not run and gets skipped. If yes, then either one more more conditions in your code is not correct or you don't have related data. It will be easier to create SQL script, check the data and manipulate the sql script to ensure no issues in query.
It's not clear to me what you mean by "The highlighted part is skipped after reading the While Select statement". Please elaborate.
By the way, your code will be easier to read if you include line indentation. I strongly recommend using Insert > Code (in the rich-formatting view).
I moved your question from Dynamics AX forum and changed the category to Development / Customization / SDK.
André Arnaud de Cal...
292,031
Super User 2025 Season 1
Martin Dráb
230,868
Most Valuable Professional
nmaenpaa
101,156