Multiple key and change

Chacal33
Participant II

Hi all,

My app will allow staff to log their working hours.
So I have a table with StaffID / Date / WorkSiteID / HoursWorked.
So far nothing complicated.
In order to avoid duplicated entries, i created a computed_key with StaffID / Date / WorkSiteID
So far so good.

However, when an entry is entered, I cannot change it afterwardsโ€ฆ

I do not know how to avoid duplicates and be able to change it afterwards.

Many thanks in advance for your returns!

Matt

0 3 99
3 REPLIES 3

Austin
Participant V

I donโ€™t recommend making the computed key based off of things in the table. Best solution is to have a true key([ShiftKey] maybe) that is just a UNIQUEID() but set the valid if for the key to be if StaffID+Date+WorkSiteID is not already in the table. If any field is invalid then it will not let you save a form view so you can realistically have any field you want have this valid if.

Hi Austin

There actually is a UniqueID for this table. However, it cannot avoid dupiclatesโ€ฆ

Steve
Participant V

A key column value cannot change once its row is saved. If a computed key is used, none of the column values used to compute the key can change, as their change would change the key column valueโ€“which cannot happen.

Top Labels in this Space