4D v16.3

Is record loaded

Home

 
4D v16.3
Is record loaded

Is record loaded 


 

Is record loaded {( aTable )} -> Function result 
Parameter Type   Description
aTable  Table in Table of the record to examine or Default table if this parameter is omitted
Function result  Boolean in True if the record is loaded Otherwise False

The Is record loaded command returns True if aTable’s current record is loaded in the current process.

4D Server: In principle, when tables are linked by automatic relations, the current records of related tables are loaded automatically (see About Relations). However, for optimization reasons, 4D Server only loads these records when necessary, for example when reading or assigning a field of the related record. As a result, in this context the Is record loaded command will return False in remote mode (it returns True in local mode).

Example  

Instead of using the “Next record” or “Previous record” automatic actions, you can write object methods for these buttons to improve their operation. The “Next” button will display the beginning of the selection if the user is at the end of the selection and the “Previous” button will show the end of the selection when the user is at the beginning of the selection.

  ` Object method of the “Previous” button (without an automatic action)
 If(Form event=On Clicked)
    PREVIOUS RECORD([Group])
    If(Not(Is record loaded([Group])))
       GOTO SELECTED RECORD([Group];Records in selection([Group]))
  `Go to the last record in the selection
    End if
 End if
 
  ` Object method of the “Next” button (without an automatic action)
 If(Form event=On Clicked)
    NEXT RECORD([Group])
    If(Not(Is record loaded([Group])))
       GOTO SELECTED RECORD([Groups];1)
  `Go to the first record in the selection
    End if
 End if

 
PROPERTIES 

Product: 4D
Theme: Records
Number: 669

This command can be run in preemptive processesDifferent in remote mode

 
HISTORY 

Created: 4D v6.5

 
ARTICLE USAGE

4D Language Reference ( 4D v16)
4D Language Reference ( 4D v16.1)
4D Language Reference ( 4D v16.2)
4D Language Reference ( 4D v16.3)