Hello!
We are using the standard time sheets in Business Central, and we figured it would be nice to have the date for the line available. I understand the date of the time sheet line is stored in the Time Sheel Detail table, and I can see the date for each line in there.
My end goal is to show the date in the invoice sent to customers, but to get there, I thought I could use a lookup field in my Time Sheet Line table to get the date for each line, and then work from there.
Already here is where I am facing issues, and I don't quite understand why. I am quite confident with lookup fields, but this one is giving me a hard time. This is what my field looks like in my Time Sheet Line table extension:
field(50103; LineDate; Date)
{
FieldClass = FlowField;
CalcFormula = Lookup("Time Sheet Detail".Date WHERE("Time Sheet No." = FIELD("Time Sheet No."),
"Time Sheet Line No." = FIELD("Line No.")));
}
I see similar ones are already used in the Time Sheet Line table, for example for "Total Quantity". It is a sum field, but it should work the same way. I even tried to copy the "Total Quantity" field into my table extension and change the name and ID of it to see if it would give me anything in return, but no - nothing.
So my LineDate field returns (Blank), and my copy of the "Total Quantity" field returns 0. The actual "Total Quantity" field returns 6,5, and I can see there are dates connected to the Time Sheet Details line.
How can I make a lookup that gets the date from the Time Sheet Details table?