Page 1 of 1

Save parent form from modal window

Posted: Wed Jan 25, 2017 3:23 pm
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

Re: Save parent form from modal window

Posted: Wed Feb 15, 2017 12:01 am
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

Re: Save parent form from modal window

Posted: Mon Jun 05, 2017 8:49 pm
by faari
Is there an easy way to suck these in, or must I manually duplicate them and keep them in sync?