problem child, parent

Hello everybody. I have 3 parent, child, grandchild tables.
Usually by inserting a new child directly from the parent form, it automatically filled in the relative ref field with the ID of the parent.
Instead the Ref field remains empty, I removed any formulas, tried to remove the check "is a part of" and then put it back but the problem remains.
Am I wrong something?

0 7 106
7 REPLIES 7

Steve
Platinum 4
Platinum 4

Please post a screenshot of the column configuration screen for the column of the child table that contains the Ref to the parent table.

Please also post a screenshot of the configuration screen for the Related ... virtual column of the parent table that corresponds to the problem child table.

i checked all the settings .... deleted the column and then recreated. Now it works perfectly. Thanks for your concern Steve

rectification. The problem has just come back.
I just did some record adding / deleting tests to verify the operation.

Here are the screenshots of the Ref column and the relative field of the parent table (related INTERVENTI RADICALIs)

2022-09-20 11_52_45-Window.png

 

2022-09-20 11_53_35-Window.png

 

2022-09-20 11_53_50-Window.png

 

2022-09-20 11_54_47-Window.png

 

2022-09-20 11_55_12-Window.png

 

2022-09-20 11_55_29-Window.png

 

It seems to really depend on
ORDERBY (REFROWS ....) as written in this post https://www.googlecloudcommunity.com/gc/AppSheet-Q-A/Wrapping-an-ORDERBY-around-a-Ref-Rows-causes-th... 

in fact I have included ORDERBY to implement this Manual Sorting 

do you have effective solutions to solve this problem @MultiTech ?

It's all about the "ref context" of where you're creating the child record.

  • If you're looking at "the parent" of the child (either in the detail view, or the form (if you've turned on the "is a part of" toggle))....

When you create a child record, using the sys-gen "ADD" action, "ref-magic" takes over and the parent's ID is copied forward

--------------------------------------------------------------------------------------

Making sure all ref columns have a value is a matter of:

  1. using a formula (initial or app) to populate the field; or 
  2. Setting the value in the action you're using to create the record (or go to the form)

--------------------------------------------------------------------------------------

Depending on where you're creating the record, you can use that ref-context to gain further refs - dereferencing the parent of your parent record... and it's parent... and it's parent - etc.

--------------------------------------------------------------------------------------

Typically what I'll do, when creating a Grandchild record, is set the parent record using an app formula - pulling the parent ID from the Child record that the grandchild is connected to.

This way, when I create the record... all I have to do make sure I set the Child-ref for the grandchild record.. this then in turn sets the parent ref automatically (because of the app formula).

2022-09-27 19_48_28-PARTITARIO CLIENTI 2022.xlsx - Excel.png

 

this is the "RELATED FOLIAR INTERVENTIONS" (child) inline view, inserted in the "PIANI_detail" (Parent) view. I always add the child records from the Add action that you find in the inline view and usually the REf to the parent happened by itself without formulas.

Since I implemented Manual sorting with its ORDER BY() this "magic" no longer works. By removing Order BY, however, the Ref to the parent happens correctly. Is there a way to keep both Manual Sorting and the above "magic"?
I don't know what formula to set to take the parent record into the child record in this context


@bolognesiedalla wrote:

Since I implemented Manual sorting with its ORDER BY() this "magic" no longer works. By removing Order BY, however, the Ref to the parent happens correctly.

Is there a way to keep both Manual Sorting and the above "magic"?

I don't know what formula to set to take the parent record into the child record in this context


--------------------------------------------------------------------------------------------------

Is there a way to keep manual sorting and ref-magic...

  • no...
  • but maybe, depending on how you're using things

Generally speaking, whenever I've got to make a manual ordering thing - there's usually a way you can get the best of both worlds... it's just tricky to get right, and you have to have the right situation.

I'm actually working on something with this right now, here's what I did:

  1. On the parent table, where I want to MAKE the child records
    • I'll show the standard REF_ROW()
    • For the sys-gen view for the table, I sort based on the ordering column

      This gives me the ability to use the system-add button under the inline view to make the records; AND they're sorted in the correct order.
  2. On the parent table, I create a hidden VC to order the child records
    • Create a new VC:  [Table_Ordered_Whatevers]
    • Something like the following formula:
        - ORDERBY([Related Whatever], [Manual_Sort_Column])
    • Hide this VC

  3. On any other table, where I want to get the list of items:
    • I call the Ordered VC, NOT the system list
    • This ensures that the list is in the correct order everywhere else I'm using it

-----------------------------------------------------------------------------------------------------------

Often times this can prove tricky to get working

In these instances, I'll resort to hiding the sys-add button, and create my own LinkToForm() deeplink action - carrying over whatever ref-context I have, then using dereference formulas to get the rest from whatever I'm carrying over

LinkToForm("FORM_NAME_HERE"
	"COLUMN_TO_SET", [VALUE_TO_SET_IT_TO]
)

 

Top Labels in this Space