How to check the cached records to prevent a key violation error when ApplyUpdates is called? Cause the cached records may have duplicated primary keys that do not exists in table.
Who is Participating?
keksperteConnect With a Mentor Commented:
when your program knows the new key, make a verify read with it in on a second chanel ( open the table with a second dbtable component i.g. name it 'temp' so that your origin tablecomponent become not be reflected). With this testread you will be able to catch all conflicts on the fly. Also you have not to enter the whole record and this method prevents you on prewrites.

hope this fix your problem
check everything in the BeforePost event. This way it will check any record before posting (and tehrefore before puting it to the CacheUpdates)

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.