Welcome to the nuBuilder Forums!

Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.

Pass variables between forms (frontend)

Questions related to using nuBuilder Forte.
Post Reply
Uzlander
Posts: 65
Joined: Sat Jul 08, 2023 10:21 am
Has thanked: 12 times
Been thanked: 5 times

Pass variables between forms (frontend)

Unread post by Uzlander »

Hi community. I think this isn't an issue for many NB devs, but recently i've been struggling with that.
Details: Have 2 distinct forms (conventional 'Contracts' and 'Payments') where the Contract has 'contract_num' among its objects and
a button which opens (popup or new breadcrumb) 'Payments' form. And that Payments in turn must have its 'contract' field auto-filled with the '#contract_num#' if opened via 'Contracts' button (& not editable) and just empty (& editable) otherwise.
So i thought i have done something similar using .parent method in past, but here it seems not working, maybe 'Contracts' not considered a parent for the 'Payments' and its just the context needs to be passed somehow..
What's the standart or recommended ways to share context (pass variables) between forms appwide ?
kev1n
nuBuilder Team
Posts: 4587
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 76 times
Been thanked: 536 times
Contact:

Re: Pass variables between forms (frontend)

Unread post by kev1n »

As long as “Payments” is opened as a popup, all fields can be accessed from its parent form “Contracts.”
Otherwise, use nuSetProperty() to set a global hash cookie (set the third parameter to true) and retrieve it with nuGetProperty()
Post Reply