Page 4 of 5

Re: Javascript error when adding a new record

Posted: Fri Sep 26, 2025 7:29 pm
by kev1n
Does the saving problem occur only with one form or with all forms?

Re: Javascript error when adding a new record

Posted: Fri Sep 26, 2025 7:45 pm
by Paul
Just the one form.

Re: Javascript error when adding a new record

Posted: Fri Sep 26, 2025 8:12 pm
by steven
Paul,

I don't think we are looking at the same database you are using.

For instance this Form's Spirit ITC Investigators Present, the items are from an array and not linked to a table.

Is this the way your problem Form is supposed to work - without linking to another table of investigators?

no_link_inv.png


Steven

Re: Javascript error when adding a new record

Posted: Fri Sep 26, 2025 8:38 pm
by Paul
Yes, that is the way it is intended to work. And we are looking at the same database.

Re: Javascript error when adding a new record

Posted: Fri Sep 26, 2025 8:48 pm
by Paul
From one of my previous posts here:

"I removed the foreign keys (to devices and investigators tables) from the cases table and even removed the two tables (devices and investigators). I was not using them anyway, was trying to set them up before, but dropped the whole idea. So I removed them from the equation altogether. But still seeing the same error.

An additional note: I can make changes to EXISTING records and save them, but still cannot save NEW records."

Re: Javascript error when adding a new record

Posted: Fri Sep 26, 2025 9:09 pm
by Paul
I got it working!

I failed to remove two columns related to the devices and investigators tables. Once I removed those as well as removing the devices and investigators tables, all is well. Geez.... I must sincerely apologize for the trouble and headaches I may have caused the both of you.
Moving on...

Update 9-26-2025 2:09pm
NOT fixed....now I get the same error as before when cloning a record...

Re: Javascript error when adding a new record

Posted: Fri Sep 26, 2025 10:57 pm
by Paul
I hate to bring the bearer of this news, but...this error has resurfaced.
Now it happens when I try cloning any record (not an object).
Uncaught TypeError: Cannot read properties of null (reading 'style')
at nuSetBrowseColumns (nuform.js?ts=20250926225156:4957:12)
at nuDragTitleEvents (nucommon.js?ts=20250926225156:2150:2)
at nuBuildForm (nuform.js?ts=20250926225156:145:2)
at Object.successCallback (nuajax.js?ts=20250926225156:193:4)
at c (jquery-3.7.1.min.js:2:25304)
at Object.fireWith [as resolveWith] (jquery-3.7.1.min.js:2:26053)
at l (jquery-3.7.1.min.js:2:77782)
at XMLHttpRequest.<anonymous> (jquery-3.7.1.min.js:2:80265)Understand this error

Re: Javascript error when adding a new record

Posted: Fri Sep 26, 2025 11:07 pm
by Paul
I'm thinking of just re-creating this project from scratch...ouch.

Re: Javascript error when adding a new record

Posted: Sat Sep 27, 2025 3:22 am
by steven
Paul,

I think we would all like that.


Steven

Re: Javascript error when adding a new record

Posted: Sat Sep 27, 2025 6:13 am
by Paul
Gentlemen,

In the process of re-creating this database project, I found the culprit that has been plagueing me with the javescript error:

It was the DISPLAY object that I created to display the current record id in the form.
Namely, the SQL query:
select pk_inv_case_no from cases WHERE pk_inv_case_no = '#RECORD_ID#';

Once I deleted that object entirely, I could create and save new records, I could also clone existing records.

So what alternate way can I implement to display the current record id (in the EDIT form) without causing this awful problem?
Or should I be avoiding trying to do that?
The record ID does display in the main BROWSE form.
Case-ID.PNG