Hi,
I'm trying to look for records in a certain period inside my sysOperationFramework class. But the while loop is not being entered:
while select table1
where table1.InventLocationId == 'XX'
&& DateTimeUtil::date(table1.CreatedDateTime) >= _contract.parmFromDate()
&& DateTimeUtil::date(table1.CreatedDateTime) <= _contract.parmToDate()
{
info("hello");
}
what did i do wrong?
However, when i did this code in a runnable class. it returned the correct records:
while select table1
where table1.InventLocationId == 'XX'
{
FromDate fromDate = DateTimeUtil::date(table1.CreatedDateTime);
if(fromDate >= 25\6\2024 && fromDate <= 26\6\2024)
{
Info("hello");
}
}
what i want is:
1. When fromDate and ToDate in the contract parameter are empty, then my while select should return everything
2. When ToDate is filled alone and From is Empty, then the while should return all records that have createdDateTime <= ToDate
3. When Both are filled, then it should return records in this period