KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Allow subforms to access parent form variables directly
PRODUCT: 4D | VERSION: 19 | PLATFORM: Mac & Win
Published On: October 24, 2022

Typically when working with Form variables between parent and subform, assigning the subform container variable as a New object would only allow the subform to access its own form variables without any context of the parent. In this scenario, the subform would have to call the subform container in order to update any Form variables from the parent.

However, if the subform container variable was assigned the value "Form", any form variables from the subform will now be able to update anything in the parent without calling the subform container.



Take for example the parent variable Form.parentVar and a subform button.



Since the subform container is assigned the value "Form", it will have full context of the parent variables and the button can freely update Form.parentVar directly.