Having trouble with Nested Forms

I'm working to get Notes as a child of another table added to my app. Essentially copying the CRM app template example. 

I'm able to add Notes, but only from one View (View #1) that is using the system-generated detail. This view is referencing the Data Table directly.

I have another View (View #2) that references a Slice. If I add a Note using View #1, I can see the Note when I navigate to View #2. But there's no "Add" button on View #2. 

The Notes DataTable has "Add" enabled. But I'm not sure why I can add Notes from View #1 and not View #2?

Solved Solved
1 5 371
1 ACCEPTED SOLUTION

@Marc_Dillon Okay I think I figured it out. 

I manually tried to set up my App similar to the CRM template. Somehow, due to the order I added things, the "Reference Notes" column in my Opportunity (parent) table ended up being a List and there wasn't a Ref in a "Type Details" section. So after going to the Notes table, updating the Opportunity to "isPartOf" then deleting the Notes virtual column from Opportunities, AppSheet recreated the virtual column in the correct way. 

View solution in original post

5 REPLIES 5

Does the "Update Mode" of a Slice used by a View affect the "Update Mode" of associated child records?

Is it possible to have a View that disallows Adds on the Parent table, but allows Adds on the Child table? 

A related question that I'm not sure about... when I'm in a View and Edit a record, it displays the Edit view which is mapped in "Row Selected". But how does AppSheet know which "view" to use to display the child records (the Notes)? Where is this set? 

I recommend against using nested forms, it leads to trouble. Specifically, users adding a bunch of records before accidentally cancelling out too far and losing everything they just added. I haven't used a nested form in over 3 years, across several dozen apps.

Assuming your "View 1" and "View 2" are both form views... a table can only have a single Ref column that is marked as "isPartOf". It's that ispartof setting that makes the add button show up in the form view of the referenced record. I'm guessing that's your issue.

Does the "Update Mode" of a Slice used by a View affect the "Update Mode" of associated child records?


No.

how does AppSheet know which "view" to use to display the child records (the Notes)? Where is this set? 


You mean the inline view?

https://www.googlecloudcommunity.com/gc/AppSheet-Q-A/How-appsheet-determines-the-view-type-of-a-rela...

 

 

 

Hi Marc_Dillon, thanks for the reply.

I'm not 100% sure I'm using the right terms / not sure if "nested forms" is what I'm trying to do. 

I have a table of "Opportunity" records, and while a user is updating the Opportunity record (using a custom View Form, not inline on a table), I'd like them to be able to optionally add a Note. So each Opportunity could have multiple Notes associated with it, and other Users could read the Notes when viewing the Opportunity.

For right now, the Notes only need to record date/time created, user that created it, and some text.  

Looking further into the CRM template on the Contacts table, the "Notes" virtual column is a type "List" with a formula of REF_ROWS("Notes", "Contact"). The "isPartOf" field seems to only be available for type "Ref", I suspect this may be a 1 to 1 relationship between tables. 

I'd like 1 to many here, or more specifically, 0 to many, as an Opportunity record could have zero to many notes. 

As I mentioned it seems to work on a non-custom ("system"?) generated view, I'm not sure why that's different if I created the view. 

 

@Marc_Dillon Okay I think I figured it out. 

I manually tried to set up my App similar to the CRM template. Somehow, due to the order I added things, the "Reference Notes" column in my Opportunity (parent) table ended up being a List and there wasn't a Ref in a "Type Details" section. So after going to the Notes table, updating the Opportunity to "isPartOf" then deleting the Notes virtual column from Opportunities, AppSheet recreated the virtual column in the correct way. 

Top Labels in this Space