I made a little script that checks if total value is above 10000. If it is; it returns true and gives a warning, if not; it returns false. Somehow my script always returns true. Does someone know why?
public Boolean Execute()
{
ScriptRecordset offerItemRS = this.GetRecordset("R_OFFERDETAILITEM", "" , "FK_OFFER = "+this.RecordId, "");
if(offerItemRS != null && offerItemRS.RecordCount > 0)
{
offerItemRS.MoveFirst();
double total = 0.00;
while(!offerItemRS.EOF)
{
double price = (double)offerItemRS.GetField("TOTALAMOUNT").Value;
total += price;
offerItemRS.MoveNext();
}
if(total > 10000)
{
return true;
}
else
{
return false;
}
}
else
{
return false;
}
}