I am getting an exception on a FindKey call. The error states that the name of my primary key must have a value ('Field "ID" must have a value'). This seems to only happen when the dataset is empty. Now, this dataset is in a shared data module. The error occurs after a form with a dataset component (that points to the same physical table as the shared one) has posted. The FindKey is done to reposition the record pointer in the shared dataset; this is when the exception occurs. Interestingly, a lookup dataset in the shared data module (again pointing to the same table) does a FindKey as well, but does not error. Any one have any ideas about what may be going on here? Or a possible solution/workaround?
This is a tricky problem. This does not happen to me on my dev machine. I've stepped through the code, seen that the primary key value is indeed empty, but the FindKey works properly for me. It only happens on other machines after the app has been installed.
This is a tricky problem. This does not happen to me on my dev machine. I've stepped through the code, seen that the primary key value is indeed empty, but the FindKey works properly for me. It only happens on other machines after the app has been installed.