ERLB not saving children

ERLB not saving children

Old forum URL:

Munish Sehgal posted on Monday, November 15, 2010

hi...i have two tables: 1.Root 2. Child

the code templates used are:

RootList: DynamicList

Root: EditableRoot

ChildList: EditableChildList


i have binded these objects to Datagridviews. When i change the RootList Selected item it save itsef. but when i change the child properties it dont save until i dont change the RootList SelectedItem in datagridView..

i don't know ... Is it because of my wrong selection for business object templates Or ERLB doesn't support.


JonnyBee replied on Monday, November 15, 2010

Any root object that has children and want to do an "autmatic" save on the child list should call

1. FieldManager.UpdateChildren()                    (will update all child lists)

2. DataPortal.UpdateChild(ChildObject)          (will update the specified child list)

In the DataPortal_Insert/DataPortal_Update methods.

A child list should not have their own Save method - calling Save on an object marked as child will throw an Exception.



Munish Sehgal replied on Tuesday, November 16, 2010

hi jonney, thanks for your reply. Actually i want to make my Root object to save its children automatically.

The problem is : when i change the property of root in gridview it performs an Dataportal_update/insert for that root object but when i change the property of the children the Root don't calls dataportal methods until i change current row in Root Grid.

Every time i want to save children i changes the selection in the root grid.

My RootListObject is a DynamicRootList and RootObject is EditableRoot.

ChildListobject is EditableChildList and Childobject is EditableChild.

JonnyBee replied on Tuesday, November 16, 2010

Then your object structure is nearly impossible.

An object structure can only be saved by calling Save on the root node - not on the children.

DynamicRootList is specifically made for "Access" like tables where the List automatically calles Save on the item.
IE: DynamicRootList is a list of Root objects for a very specific purpose. 

You _may_ use 2 DynamicRootLists and have a filter/fetch method on the child list but I'm not sure about the performance tho'.


Munish Sehgal replied on Tuesday, November 16, 2010

ok. So What should be the object structure for a parent-child Tables to be used as Auto update datgridview.....

the tables are : Trigger and TriggerDet

I am sure about Trigger table that i should use DynamicRootList for TriggerList(parent datagridview) and EditableRoot for Trigger.

But confused which templates should be used for TriggerDetList and TriggerDet.

I hope i am able to describe the problem and you are getting me in right path.

JonnyBee replied on Tuesday, November 16, 2010

The point is that you must have 2 separate DynamicRootList and handle the parent/child relationship in your form.No relationship in code only in logic.

When a new "parent" is selected you must fetch a new Root list of "child" and display in child grid.



Copyright (c) Marimer LLC