Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Copying Data from Popup Form to Main Form Topic is solved

Questions related to using nuBuilder Forte.
Post Reply
yvesf
Posts: 337
Joined: Sun Mar 14, 2021 8:48 am
Location: Geneva
Has thanked: 92 times
Been thanked: 11 times

Copying Data from Popup Form to Main Form

Unread post by yvesf »

Hello,

I have two forms linked via the patient_id.

The main form is a browse and edit form.

It has a button that opens a popup form (edit form).

In the popup, there's a note field (a text area).
I would like to copy the content of this note field into the main form, specifically into a textarea field called cs_CR.

I tried using the following code behind a button in the popup:

Code: Select all

nuSetValue('parent.cs_CR', nuGetValue('note'));
But it doesn't work — apparently the main form’s fields are not accessible from the popup. The console reports that the object does not exist.

One possible solution would be to call a server-side procedure to update the main form field.
However, I'm wondering if there's a simpler or cleaner alternative to achieve this?

Thanks a lot for your continuous help.

Yves
kev1n
nuBuilder Team
Posts: 4416
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 74 times
Been thanked: 472 times
Contact:

Re: Copying Data from Popup Form to Main Form

Unread post by kev1n »

parent.nuSetValue('cs_CR', nuGetValue('note')); ?
yvesf
Posts: 337
Joined: Sun Mar 14, 2021 8:48 am
Location: Geneva
Has thanked: 92 times
Been thanked: 11 times

Re: Copying Data from Popup Form to Main Form

Unread post by yvesf »

THX KEV1N !!! the correct syntax is this one.
Post Reply