Search code examples
google-app-maker

How do I fix this? Relation Error - TypeError: Cannot read property - Creating new record: (Error)


A short description of the issue:

I can't make a new page, 2 data source relation function in my app (which has similar existing pages with relations that work). The new relation always produces the following error on the parent table:

E Fri Nov 08 08:10:55 GMT-700 2019 TypeError: Cannot read property "EkYkTNJF93VWDxnS7Gi1OIIBSsHXTZ7H" from null. E Fri Nov 08 08:10:55 GMT-700 2019 Creating new record: (Error) : Cannot read property "EkYkTNJF93VWDxnS7Gi1OIIBSsHXTZ7H" from null. at Apex_Office_Time.Table1Panel.Table1.Button1.onClick:1:19 E Fri Nov 08 08:10:55 GMT-700 2019 Creating new record failed.

I I am always able to produce the error even when I start a new app from a blank template. The error will occur & not show the new record. Yet if I refresh, the record will be there. Existing apps with similar relations always work.

001 Here is the data source relation between the 2 data sources

Here is a newly set up Google cloud SQL data source "Apex_Office_Time"

Here is the Second Data source "Apex_Office_Time_Details"

Here Is the Page "Apex_Office_Time" which contains a table. The blue + button should create a new item on the table. It does when there is no relation between the data sources

Here is a shot that of the page that show the data source for the table is related to "Apex_Office_Time"

Here is the generated preview before I hit the + button

Here is the generated preview after I hit the + button & complete with error code

Here is the generated preview after I hit the + button, and after I manually hit the refresh button on my browser. I get the same results in Chrome, Firefox, & MS Edge

Further points of note:

  • When I set up a table that generates items for the "many" side of the relationship "Apex_Office_Time_Details", new items for this table are created without issue.

  • I just added a third data source to the mix "Apex_Office_Test". I then made "Apex_Office_Time_Details" to "Apex_Office_Test" a one to Many relation. I then tested to see if I could create items in "Apex_Office_Time_Details" without issue as before. I was successful. I then tested to see if I could create items in "Apex_Office_Test". I was successful. I then deleted the "Apex_Office_Time" data source and retested the other 2 tables and their data sources. I was successful. It seems very odd, but its working. I am going to continue testing based on this line.

  • Success! Evidently there is a minimum length for the names in data sources. The number fields "b" & "bh" in the data source "Apex_Office_Time_Details" was the issue. When I deleted them the table worked. Then I tried renaming the fields to "Billed" & "Billable_Hours" and everything seems to be working


Solution

  • Success! Evidently there is a minimum length for the names in data sources. The number fields "b" & "bh" in the data source "Apex_Office_Time_Details" was the issue. When I deleted them the table worked. Then I tried renaming the fields to "Billed" & "Billable_Hours" and everything seems to be working