Load data from database to List by Current Date

Load data from database to List by Current Date

  

Hi,


I'm stuck.

What I want to do is load data to a List from a date stored in a database. 

The database has Customer, LastDone, DueAgain and Days columns.

I want to display the customer  if the date in the DueAgain Column is less than or equal to the current date.

e.g. If (date in DueAgain <= currDate())

       {

               Display Customer in List

       }

Then I want a button called Done for when the job is done.

When clicked i want the current date to be put in the LastDone column for that customer and the DueAgain column to be updated by date in the LastDone column plus the value that is in the Days column. Then update or refresh the List.

e.g. If (DoneButtonClicked)

       {

              LastDone == CurrDate();

              DueAgain == LastDone + Days; 

              or DueAgain == AddDays(LastDone, Days);

              UpdateOrRefreshList();

       }

I've tried a filter on the database 

CustomerList.DueAgain <= CurrDate() but the List is still displaying all the records even the ones that have a date greater than current date. It displays C1 C2 C3 C4 C5 C6 C7 C8 C9 C10 C11.

How do I apply the filter to the List?

I've even tried enclosing the List with an if with the condition -  GetCustomerLists.List.Current.CustomerList.DueAgain <= CurrDate() but the results are strange. It now displays C1 C1 C10 C11 C2 C2 C3 C3 C4 C4 C5 C5 C6 C6 C7 C7 C8 C8 C9.

As you can see no duplicates of C10 C11 or C9.

Still not behaving as I would expect?

Any help?

Thanks,

Karl.

Hi Karl,

The easiest way to do this is with an aggregate that gets only records where DueAgain <= CurrDate(). This should work just fine. Even when you have a TableRecords with a filter above it, you can best use this filter and refresh the aggregate.

Can you provide an example with values of the table? This way it's easier to help you.

Regards,
Lennart