Slice based on most recently added record

I have a table that contains Orders and another that contains Time Sheets
I need to populate a record in a Job Card table to store the customer’s signature for selected Time Sheets linked to an Order.

I’ve created a FORM to create a new Job Card.
On this form, the user enters a date and selects an Order from the Orders table (Ref field). The form generates a new Job Id, and saves it in the Job Cards table.
So far, so good.

However, after the new Job Id has been created, but before the customer signs, I need to display a list of Time Sheets linked to the selected Order and allow the user to select the Time Sheets to be included in this job card.
To do that I need to:

  • Create a slice that lists all the Time Sheets that are related to the selected Order.
  • Display that list of Time Sheets and allow the user to select the Time Sheets he/she wants included on the newly created Job Card
  • Update the selected Time Sheet records to include the newly created Job Id (I can do that progressively as each record is selected with an Action)
  • Display a form with a summary of the information for the customer to sign.

To achieve that, I need to somehow be able to refer to the Order Id that was selected or at least the new Job Id that has just been created. Since I can’t use memory variables to store that information, how can I keep track of the required references? I know I could reference the last record entered in the Job Card table if I look for MAX Row Number, but what if two employees create a new job card at around the same end of day time?

How would you personally differentiate them?

Technically there’s no need to differentiate them or record who prepared the Job Card. However I guess your comment is trying to say I need to add a Prepared By field and then use the most recently entered record by that employee to look up the Order Id and Job Id.

1 Like