nuOpenForm issues after saving parent form
Posted: Thu Aug 24, 2017 10:26 pm
TL:DR
Using nuOpenForm on a subform grid's record after saving the main form makes it so I can't go back to the main form.
Hello,
I have a main form (A), with a grid subform (B). I am using the below code to open an edit form (B) for the records in the subform (B).
The opened edit form (B) contains fields that are on the main form's (A) subform grid (B) as well as quite a few other ones.
function openItem(t){
var rw = $('#' + t.id).attr('data-prefix'); //-- current row in subform
var id = rw + '_nuPrimaryKey'; //-- Primary Key for record in subform
var fpk = '5915002745f94d7'; //-- Form Primary Key
var rpk = $('#' + id).val(); //-- Record Primary Key
// window.nuControlKey = true; //-- simulate holding down CRTL (open in new Tab) <--- didn't work for me, so commented it out
nuOpenForm('#FORM_ID#', '#RECORD_ID#', fpk, rpk);
// nuOpenFormInFrame(fpk, rpk);
// window.nuControlKey = false; <--- didn't work for me, so commented it out
}
if I use nuOpenForm, one of two things happen
If I have not opened and saved the main form (A) before opening the edit form for (B), I can open records (b) and save them, and I can close the form and go back to (A) where the records in subform (B) are updated.
If I have opened and saved form (A) before opening the edit form, whether I make changes or not, when I click to go back to the previous form (A) using the breadcrumb, nothing happens.
If I click on the breadcrumb a second time, I get "Uncaught TypeError: Cannot read property 'call_type' of undefined at nuBuildForm at nuGoToForm at HTMLSpanElement.onclick" in the console.
If I attempt to change a field on form (B) I get Uncaught TypeError: Cannot read property 'edited' of undefined at nuSetEdited at HTMLInputElement.onchange.
If I used nuOpenFormInFrame,
I can open form (B), save records and close the window, but the data doesn't update on form(A)'s subform (B). When I hit save on form (A), the values already on the subform (B) save over the top of what was entered in the edit form for (B).
If I use nuOpenForm after saving form (A), and save form(B), I can call another function of nuOpenForm on an Extra action button, but then I have 2 extra breadcrumbs and it still doesn't always work.
Using nuOpenForm on a subform grid's record after saving the main form makes it so I can't go back to the main form.
Hello,
I have a main form (A), with a grid subform (B). I am using the below code to open an edit form (B) for the records in the subform (B).
The opened edit form (B) contains fields that are on the main form's (A) subform grid (B) as well as quite a few other ones.
function openItem(t){
var rw = $('#' + t.id).attr('data-prefix'); //-- current row in subform
var id = rw + '_nuPrimaryKey'; //-- Primary Key for record in subform
var fpk = '5915002745f94d7'; //-- Form Primary Key
var rpk = $('#' + id).val(); //-- Record Primary Key
// window.nuControlKey = true; //-- simulate holding down CRTL (open in new Tab) <--- didn't work for me, so commented it out
nuOpenForm('#FORM_ID#', '#RECORD_ID#', fpk, rpk);
// nuOpenFormInFrame(fpk, rpk);
// window.nuControlKey = false; <--- didn't work for me, so commented it out
}
if I use nuOpenForm, one of two things happen
If I have not opened and saved the main form (A) before opening the edit form for (B), I can open records (b) and save them, and I can close the form and go back to (A) where the records in subform (B) are updated.
If I have opened and saved form (A) before opening the edit form, whether I make changes or not, when I click to go back to the previous form (A) using the breadcrumb, nothing happens.
If I click on the breadcrumb a second time, I get "Uncaught TypeError: Cannot read property 'call_type' of undefined at nuBuildForm at nuGoToForm at HTMLSpanElement.onclick" in the console.
If I attempt to change a field on form (B) I get Uncaught TypeError: Cannot read property 'edited' of undefined at nuSetEdited at HTMLInputElement.onchange.
If I used nuOpenFormInFrame,
I can open form (B), save records and close the window, but the data doesn't update on form(A)'s subform (B). When I hit save on form (A), the values already on the subform (B) save over the top of what was entered in the edit form for (B).
If I use nuOpenForm after saving form (A), and save form(B), I can call another function of nuOpenForm on an Extra action button, but then I have 2 extra breadcrumbs and it still doesn't always work.