Log In    |    Knowledge Base    |    4D Home
Tech Tip: Utilizing 4D Debugger to Investigate Object Notation
Published On: February 12, 2024

A useful feature of the 4D debugger is the ability to utilize the expression pane to traverse through the attributes of expresions evaluating to an object. Some databases can be large and hard to keep track of every table field or class attributes. When testing and developing new features and using the method editor, placing a TRACE or a breakpoint in the method to trigger the debugger can be a quick way to easily view and explore a specific object.

For example, when working with ORDA and interacting with entity selections, tests can be performed in the expression pane. When the entity selection is placed in the expression pane, it can be expanded listing the entities (limit of first 100 in the pane) and the fields and relations of each entity can also be expanded. The entire expression is displayed which can be copied and added to the code. Functions can also be tested in the expression pane to make sure that the formatting is correct without needing to enter it into the method, running the method, viewing the results in the debugger, closing and repeating if errors were made.

One warning to this is to make sure that nothing that might cause a crash is entered into the expression pane. Because expressions are evaluated on the fly, if something like an endless loop is accidentally added to the expression pane, it can cause a crash. When using the debugger to test items, the expressions should not be saved, unless they will not cause a crash.