This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com

Home

 
4D v20 R7
Get call chain

Get call chain 


 

Get call chain -> Function result 
Parameter Type   Description
Function result  Collection in Collection of objects describing the call chain within a process

The Get call chain command returns a collection of objects describing each step of the method call chain within the current process. It provides the same information as the Debugger window. It has the added benefit of being able to be executed from any 4D environment, including compiled mode.

The command facilitates debugging by enabling the identification of the method called, the component that called it, and the line number where the call was made. Each object in the returned collection contains the following properties:

 

PropertyTypeDescriptionExample
databasetextName of the database calling the method (to distinguish host methods and component methods)"database":"contactInfo"
linelongintLine number of call to the method"line":6
nametextName of the called method"name":"On Load"
typetextType of the method:
  • "projectMethod",
  • "formObjectMethod",
  • "databaseMethod",
  • "triggerMethod",
  • "executeOnServer" (when calling a project method with the Execute on Server attribute.),
  • "executeFormula" (when executing a formula via PROCESS 4D TAGS or the evaluation of a formula in a 4D Write Pro document.)
  • "classFunction"
"type":"formMethod"

 

Note: For this command to be able to operate in compiled mode, the Range checking must not be disabled. See Range checking.

Example  

The following code returns a collection of objects containing information about the method call chain:

 C_COLLECTION($currentCallChain)
 $currentCallChain:=Get call chain

 

If a project method is executed, the call chain could contain (for example):


[
   {
    "type":"projectMethod",
    "name":"detailForm",
    "line":1,
    "database":"myDatabase"
   }
]

If a form object method is executed, the call chain could contain (for example):


[
   {
    "type":"formObjectMethod",
    "name":"detailForm.Button",
    "line":1,
    "database":"myDatabase"
   },
   {
    "type":"formMethod",
    "name”:"detailForm",
    "line":2,
    "database":"myDatabase"
   },
   {
    "type":"projectMethod",
    "name”:"showDetailForm",
    "line":2,
    "database":"myDatabase”
   }
]

 

 
PROPERTIES 

Product: 4D
Theme: Language
Number: 1662

This command can be run in preemptive processes

 
PAGE CONTENTS 
 
HISTORY 

Created: 4D v17 R6

 
ARTICLE USAGE

4D Language Reference ( 4D v20 R7)