Ownership of a record

Hi There! I have a tabel with records which should be designed, so that when a user enters a record on a form he takes the ownership of it, and there’s no-one else who can modify it! It should be so that whenever the user opens a record on a form, he takes ownership of it and looses the ownership when he leaves the record. I all-ready have a “Owner”-field on the table, but how and when do I write to it? I’ve tried it from the triggers on the form, but that doesn’t work, and neither does putting a function on the table??Help!![?]

Hi, This time the longest way is easiest. You should create into the table a new field to save the 1st users userid or workstations name. This marks who is currently locking the row. Then you need code: -to lock the row by entering the userid into the field when user starts editing -to prevent other users to edit the locked row. Row is read-only -to clear all locks of the user when she moves away from the locked row, this self-cleaning is important to avoid hanging locks. -etc… good luck!

Hi, If you are trying to make sure that 2 users cannot modify a record at the same time, please note that this is already handle by Navision. Maybe you’d like to read about “optimistic concurrency” and the “version based” data in Navision database (Programming Guide, Architecture section, chapter 3). Don’t hesitation if you need extra information…

hi, David is right, this is handled by navision it self and there is not need for the programmer to take care of it. Regards Harikesh