Log In    |    Knowledge Base    |    4D Home
Tech Tip: Locked status when updating data via 4D Open
PRODUCT: 4D Open | VERSION: 6.8 | PLATFORM: Mac & Win
Published On: July 10, 2002

When updating a record via 4D Open, you should always check to see if the record in question on the server is currently locked. When using commands such as OP Goto selected record, OP Goto record, or OP Load record you will always be returned the locked status of the record. As shown in our example below, after our call to OP Goto selected record we check the status of the record. If the record is not locked we continue with our update. If the record is locked, we alert the user.

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

If ($LockStatus=1)

 ALERT("Record is currently locked.")


 $ErrCode:=OP Update record (vl_ConnectID;vl_BindID2)

 $ErrCode:=OP Unload record (vl_ConnectID;$TableNum)

 $ErrCode:=OP All records (vl_ConnectID;$TableNum)

 $ErrCode:=OP Selection to array (vl_ConnectID;vl_BindID)

end if