New records in foundset not displayed in grids

Hi I am trying to display new records in a form which is hidden through a tab panel. Currently, when I add new records on the hidden form and try to show the form, I couldn’t see the new records. I only see the records when I add new records and call databaseManager.saveData(record).

My form structure:

  1. ParentForm-Policy Table -->This is where I call new record (New policy record and new product record)
    1.1 ChildForm1-Policy Table → This is currently selected
    1.2 ChildForm2-Policy Table → This is currently hidden from view
    1.2.1 ChildSubFormList-Product Table → Location of the form with the new product record (When I show the form, it does not display the new records)

This does not happen to me when I add records directly to forms that are currently being viewed. Do I need to manually refresh hidden forms to display new records?

Any input is highly appreciated.

Hi Erik. I think that this is because you are not adding the record thru the relation but in the child table so the parent foundset does not know about the new until you do a saveData().

Thanks for the tip. It seems to work already when I use relations.

I have another problem.

Above scenario is already working. I used policy_to_policy_has_product.newRecord to create and display new records. However, my field in another form, with relation of policy_to_policy_has_product_default.assignmentdate, displays nothing. Both policy_to_policy_has_product_default and policy_to_policy_has_product relations use Policy_has_Product Table. I believe the UI is not being refreshed as there is no call to policy_to_policy_has_product_default.newRecord. How can I refresh text fields to extract updated information from the db?
I cannot call newRecord to both relations as it will create redundant records.

Any input is highly appreciated.

Erik,

Does the data also not show via the second relation when the data is saved?

Also, does the second relation already have 1 or more records?
In that case it will just show the same record it was showing,even if a new record has arrived.

Rob

Yes, the second relation already has at least one record internally but not displayed in the UI.

Only when I call saveData that the records gets displayed.

When I call policy_to_policy_has_product.newRecord, all fields which refers to policy_to_policy_has_product relation gets refreshed and displays the correct data, but not the fields that are referring to policy_to_policy_has_product_default relation. Vise versa.

So are you saying there is no way to refresh the displayed fields?

A related foundset will only see new records not created from itself when the new records are saved in the db.

Hope this helps,

Rob

Thanks Rob for making this clear.