KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Utility method that returns the current value of an object in a subform
PRODUCT: 4D | VERSION: 19 | PLATFORM: Mac & Win
Published On: August 15, 2022

When working with a subform and specifically with dynamic variables, getting the current value of a subform object from the parent context may require a few extra lines of code to archive that. The following is a utility method to simplify this task and can be used in projects.

  // Method: getSubformObjectValue
#DECLARE($objectName : Text; $subformName : Text)->$value : Variant
If (Count parameters>=2)
  EXECUTE METHOD IN SUBFORM($subformName; Current method name; $value; $objectName)
Else
  $value:=OBJECT Get pointer(Object named; $objectName)->
End if