April 29, 200223 yr Hi All, I have recently inherited a database. One of the issues I am taking care of is an importing script. I have noticed that after this import is completed, there are multiple Replace commands to set data in other fields. I know that Replace in multi-user is destined to fail due to record locking. My question is, does it also have the potential to fail if the records are brand new (due to the import), and no users would be on those records. My analysis is, it is still possible these records could immediately lock, if say, a users database is on a record that has a portal that might relate to a newly imported record "all of a sudden". Is it necessary to "replace" the Replace command with a looping Set Field through each record and to capture any locking errors and log them if it happens? Also, What is the CurrentError code for a locked record? Thanks in advance, these boards are great!
April 29, 200223 yr If you can guarantee that no one is in the records, then the replace should work. However, as you mentioned yourself, there are known problems where records lock because they happen to appear in a portal somewhere. On the other hand, a looping script with a set field command can actually be as fast, or sometimes faster than multiple replace commands if set up carefully. So, I suggest you redo it using set fields.
Create an account or sign in to comment