I think the problem may be when you assign shipDocs at the very beginning to 
TmpXYZShipDocs. You are basically assigning the rows to shipDocs at that time, 
so I'm not sure how the while select will work. I would have expected it to 
over-write that initial assignment, but I bet it's just confusing axapta and 
causing the incorrect result.
 
In any case, since you don't appear to be using the assignment, I'd get rid of 
it.
So change your line that says:
TmpXYZShipDocs shipDocs = TmpXYZShipDocs;
to:
TmpXYZShipDocs shipDocs;

--- On Tue, 7/15/08, jquinteroz <[EMAIL PROTECTED]> wrote:

From: jquinteroz <[EMAIL PROTECTED]>
Subject: [development-axapta] Extrain behavoir in While select statement
To: [email protected]
Date: Tuesday, July 15, 2008, 7:39 AM






Hi!:

I noted a extrain behavoir in a while select 
statement.
I am using a temporary table.
I am using Axapta V3 SP6.
The method is the following:

void clicked()
{
TmpXYZShipDocs shipDocs = TmpXYZShipDocs;
SalesId xSalesId;
;

While Select shipDocs where shipDocs.Check == NoYes::Yes
{
if (shipDocs.RecId && shipDocs.Check == NoYes::Yes
&& shipDocs.SalesId != xSalesId)
{
super();
xSalesId = shipDocs.SalesId;
TmpXYZShipDocs_ ds.executeQuery( );

}
else
if(!shipDocs. RecId)
{
TmpXYZShipDocs_ ds.executeQuery( );
throw error('@XYZ261' );
}
}
}

The select is selecting all rows (like ignoring 
the where clause).
So, for a while I am doing a extra conditional
using variables (in order to avoid loop), but,
anyway, the table is read complete.
Any ideas?.

 














      

[Non-text portions of this message have been removed]

Reply via email to