KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Remember to unload records when using 4D Open for 4D
PRODUCT: 4D Open | VERSION: 6.8 | PLATFORM: Mac & Win
Published On: June 13, 2002

Platform: 4D Open for 4D

When performing an update to a record in 4D Open the record will become locked. It will be up to you to unlock the record by unloading it from memory.

The obvious example would be if you called OP Load record to load the current record. You would need to have a corresponding call to OP Unload record. Also, remember that OP Goto selected record and OP Goto record will also load the current record into memory and thus lock the record from other users. If you do not unload the record when finished, it will not be available to other users.

Example:

$ErrCode:=OP Goto selected record (vl_ConnectID;$TableNum;$RecNumber;vl_BindID;$LockStatus)

If ($LockStatus=1)
ALERT("Record is currently locked.")
Else
$ErrCode:=OP Update record (vl_ConnectID;vl_BindID)
$ErrCode:=OP Unload record (vl_ConnectID;$TableNum)
End if

As you can see from our example, we load the record by calling OP Goto selected record, then update the record with a call to OP Update record, and then finally we unload the record with our call to OP Unload record.

So remember that when you load a record you must unload it. 4D Open will not do this for you automatically when you have finished with the record.