Question about saving editable root list

Question about saving editable root list

Old forum URL:

wjcomeaux posted on Friday, December 10, 2010

I'm trying to fix a bug in the CodeSmith templates and in research I came across this thread.

Basically it shows that the ERL should just call Child_Update().
I see in our generation template that we are doing that, but only if the list itself is a child object, otherwise the template generates this code:

for (int index = 0; index < DeletedList.Count; index++)
   DeletedList[index] = DeletedList[index].Save();

for (int index = 0; index < Items.Count; index++)
    Items[index] = Items[index].Save();

Is there ever a case when this code would be valid or should the DataPortal_Update
for an ERL always just look like this:
//Configure myConnection
bool cancel = false;
OnUpdating(ref cancel);
if (cancel) return;

RaiseListChangedEvents = false;


RaiseListChangedEvents = true;


Thanks for any input,

RockfordLhotka replied on Friday, December 10, 2010

Unless you have some weird dependency issues with child objects, you should always just be able to call Child_Update to do the work. It just contains the code you listed at the top of your post after all :)

wjcomeaux replied on Friday, December 10, 2010

That is what I thought and what I was hoping. Nothing weird happening here, just addressing a bug in the templates and ot wanting to add a new one accidentally by removing potentially useful functionality.



bniemyjski replied on Saturday, December 18, 2010


Thanks for reporting this Will, I'll get this fixed. I've logged this as a bug here ( Please add any comments that you have to this bug ID.


-Blake Niemyjski

Copyright (c) Marimer LLC