Welcome to the nuBuilder forums!

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

nuOpenForm issues after saving parent form

Post Reply
mobilemcclintic
Posts: 54
Joined: Fri Oct 23, 2015 12:34 am

nuOpenForm issues after saving parent form

Unread post by mobilemcclintic »

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.
jens
Posts: 7
Joined: Fri Apr 14, 2017 11:34 am

Re: nuOpenForm issues after saving parent form

Unread post by jens »

Have you found a solution?

I've got the same error now (I think this was not the case before doing 'git pull' and getting the latest snapshot of Version 3). I have no custom js code, but whenever I hit the parent table from an "Add Record" screen: First nothing happens, then on second click the browser console says: "Uncaught TypeError: Cannot read property 'call_type' of undefined" (Chrome) or "TypeError: w is undefined" (Firefox).
jens
Posts: 7
Joined: Fri Apr 14, 2017 11:34 am

Re: nuOpenForm issues after saving parent form

Unread post by jens »

I just noticed, that clicking on the parent table in the breadcrumb lasts for about 20 seconds (my table has about 2000 records). If I click within this time a second time, then it takes this long. So it is also a severe performance problem here.
mobilemcclintic
Posts: 54
Joined: Fri Oct 23, 2015 12:34 am

Re: nuOpenForm issues after saving parent form

Unread post by mobilemcclintic »

I have not found a solution to this.
I'm fairly certain it is a bug, and as the team was getting ready for Forte, any potential update/fix would have mostly likely been routed upstream to that.
Post Reply