Save parent form from modal window

Save parent form from modal window

Postby Tinka » Wed Jan 25, 2017 11:53 pm

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
Tinka
 
Posts: 72
Joined: Mon Feb 24, 2014 11:28 pm

Re: Save parent form from modal window

Postby admin » Wed Feb 15, 2017 8:31 am

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
admin
Site Admin
 
Posts: 3223
Joined: Mon Jun 15, 2009 9:53 am

Re: Save parent form from modal window

Postby faari » Tue Jun 06, 2017 4:19 am

Is there an easy way to suck these in, or must I manually duplicate them and keep them in sync?
faari
 
Posts: 1
Joined: Tue Jun 06, 2017 4:12 am


Return to General