KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Get Locked Records Info on Client/Server
PRODUCT: 4D Client | VERSION: 17 | PLATFORM: Mac & Win
Published On: October 2, 2019

Get locked records info returns an object with details regarding locked records and related users/processes. However, calling this command in 4D Remote will return a null object. Here is an example below:



The Get locked records command is only compatible with 4D and 4D Server. When callled from 4D Remote, a null object is returned. To retrieve information regarding locked records in Client/Server mode, you will want to either call the Get locked records info command with the "On server execute" option or use the LOCKED BY command instead.

LOCKED BY command:


Get locked records info command:
  • Here are the steps to allow the Get locked records info command to return a non-null object on Client/Server mode:

    1. Call on the Get locked records info command in a new method

      C_OBJECT($0)
      $0:=Get locked records info([Table_Name])


    2. Click on the information icon in the method editor (Opens the method properties)



    3. Check the box option for "On server execute" (This sends the procedure to the server)

    4. Create another new method and insert the code below. (This second method retrieves the information back from the server and allows the debugger to be opened on the client side)

      ALL RECORDS([Table_Name])
      TRACE

      $locked:=Locked Records in Table Method


    5. Running the second method should open up the debugger. Display the variable retuned by the Get locked records info command ($locked) in the expression pane to view details regarding locked records. The object should no longer be null, as shown in the image below.