4D Blog

Home Product Form and subform communication made easy!

Form and subform communication made easy!

April 28, 2022

Product

Starting with 4D v19 R5, the ability to associate a variable with a subform has enriched the possibilities of interfaces and communication between forms and subforms. The means of communication are now simplified by two new commands: Say hello to OBJECT Get subform container value and OBJECT SET SUBFORM CONTAINER VALUE.

Improve communication between forms and subforms

Two new commands

The new commands OBJECT Get subform container value and OBJECT SET SUBFORM CONTAINER VALUE must be used in the context of the subform.

The first one – OBJECT Get subform container value will most often be used when an On Bound Variable Change event is generated, i.e., after the variable (or the expression) associated with the subform of the parent form is modified. It is therefore used to read this new value.

The second one – OBJECT SET SUBFORM CONTAINER VALUE will be used if, from the subform, you wish to modify the value of the variable (or expression) associated with the subform in the parent form.

Why these commands?

Until now, there were two ways of obtaining this information.

The simplest (and most recent) way is to associate a variable of type object with the subform. In this case, the attributes of this object are accessible directly by the Form function within the subform. This works fine but using an object when you need a simple value is not necessarily a good practice.

The second way (more historical) is to create a pointer to the variable in question via the OBJECT Get pointer command with the Object subform container parameter. This works, but only when a variable is associated with subforms. Unfortunately, this is not possible when it is an expression (e.g., Form.myValue) because it is not possible to create a pointer to an expression.

So, these two commands represent the most convenient and straightforward solution for simple cases! It will simplify the programming of the most common cases. The code will be more readable and easier to maintain.

Enjoy programming with 4D!

Discuss

Tags Form object, Language, Programming, Subform, v19 R5, v20

Latest related posts

  • November 17, 2025

    Goodbye 4D Internet Commands – Hello Modern Internet Integration

  • November 14, 2025

    Event Report in 4D Qodly Pro: See Every Interactions at a Glance

  • November 14, 2025

    4D Qodly Pro: Page Zoom Controls

Roland Lannuzel
Roland Lannuzel
• Product Owner & 4D Expert • After studying electronics, Roland went into industrial IT as a developer and consultant, building solutions for customers with a variety of databases and technologies. In the late 80’s he fell in love with 4D and has used it in writing business applications that include accounting, billing and email systems.Eventually joining the company in 1997, Roland’s valuable contributions include designing specifications, testing tools, demos as well as training and speaking to the 4D community at many conferences. He continues to actively shape the future of 4D by defining new features and database development tools.
  • Deutsch
  • Français
  • English
  • Português
  • Čeština
  • Español
  • Italiano
  • 日本語

Categories

Browse categories

  • AI
  • 4D View Pro
  • 4D Write Pro
  • 4D for Mobile
  • Email
  • Development Mode
  • 4D Language
  • ORDA
  • User Interface / GUI
  • Qodly Studio
  • Server
  • Maintenance
  • Deployment
  • 4D Tutorials
  • Generic
  • 4D Summit sessions and other online videos

Tags

4D AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R10 21 Administration AI Artificial Intelligence Build application CI/CD Class Client/Server Code editor Collections Formula Listbox Logs Mail Microsoft 365 Network Objects OpenAI ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor

Tags

4D AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R10 21 Administration AI Artificial Intelligence Build application CI/CD Class Client/Server Code editor Collections Formula Listbox Logs Mail Microsoft 365 Network Objects OpenAI ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor
Subscribe to 4D Newsletter

© 2025 4D SAS - All rights reserved
Terms & Conditions | Legal Notices | Data Policy | Cookie Policy | Contact us | Write for us


Subscribe to 4D Newsletter

* Your privacy is very important to us. Please click here to view our Policy

Contact us

Got a question, suggestion or just want to get in touch with the 4D bloggers? Drop us a line!

* Your privacy is very important to us. Please click here to view our Policy