Welcome to the nuBuilder forums!

Please register and login to view forums and other content only available to registered users.

Save parent form from modal window

Post Reply
Tinka
Posts: 73
Joined: Mon Feb 24, 2014 2:58 pm

Save parent form from modal window

Unread post by Tinka »

Hi!

I want to save the parent form from a modal window which adds new records to a subform on the parent form. The new record becomes only visible after saving the form manually. The subform links to a table with many-to-many relati0ns and uses look-ups - so it is not directly linked to the parent record.

I have this code on the After Save of the modal form but it does not work for the saving part (commented lines):

Code: Select all

$js = "
    alert('Transcript saved succesfully!');    
 
$('#pri_transidFK', window.parent.document).val('#RECORD_ID#');
$('#codepri_transidFK', window.parent.document).val('#trans_name#');

//nuGoToForm(2);
//nuSaveForm();
nuRemoveModal();
";

nuAddJavascript($js);
BR, Tinka
admin
Site Admin
Posts: 2781
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 1 time

Re: Save parent form from modal window

Unread post by admin »

Tinka,

If you are in a modal window you may need to refer to parent.

eg.

Code: Select all


parent.nuGoToForm(2);
parent.nuSaveForm();
nuRemoveModal()

Steven
faari
Posts: 1
Joined: Mon Jun 05, 2017 8:42 pm

Re: Save parent form from modal window

Unread post by faari »

Is there an easy way to suck these in, or must I manually duplicate them and keep them in sync?
Post Reply