Hello guys,
here's what I'm up to:
I have created a new table. There are the fields Code, Cost center, Valid from and Description.
In the table I have now entered three rows:
A001 C001 29.08.23 Test 1
A002 C001 01.09.23 Test 2
A003 C002 28.08.23 Test 3
Now I have created a new field in the sales order called Department. There the code A001 should be displayed if the document date of the order is identical to the values from the new table.
The sales order has the document date 29.08.23.
So the field should contain A001, because today is 08/29/23.
A003 has a different cost center and is too small by date and for A002 the date is not valid as of today.
I want to display the values in the orders via a lookup.
How can I build a date filter with MAX here?
I make a setrange on the new table where I filter on cost center, which must be as in the order.
Then two rows remain:
A001 C001 29.08.23 Test 1
A002 C001 01.09.23 Test 2
Now I make a findlast and should have only the last row.
Whose value in code I want to have in the order.
But unfortunately does not work. What am I doing wrong? Where do I have to program it and how?
Thank you.