StrataFrame Forum

Any way to update just the current row of a BO?

http://forum.strataframe.net/Topic5003.aspx

By Greg McGuffey - 12/6/2006

I have a form that calls another form. The called form is to help the user figure out the value of one of the fields in the main BO. The called form actually updates the data in the main form's BO. I'm wondering if there is an efficient way to update either just the single column in the main form's BO or even just the single row?



If I refill the BO, I will also have to refill a bunch of child BOs, so there will be a performance hit.
By StrataFrame Team - 12/6/2006

You best bet would probably be to use a ChildFormDialog to show your child window...  it is a component that you can drop on the form and configure it to show a child form.  You then drop an instance of your business object on both forms and configure the BusinessObjectTranslations on the ChildFormDialog to map between the two business objects.  At runtime, both business objects will have the same object reference, so when you update the record on the child form, you're updating the record on the main form (without requiring you to save before you return to the main form or refill the bo on the main form when you return).
By Greg McGuffey - 12/6/2006

OK, that is helpful information. Unfortunately it won't work in my case (at least for now). The child form is actually calling a stored procedure (a whole bunch of times, user driven (this is related to that DataGridView question)), to toggle a value in another table and if the toggle meets some rule, it changes a column in the parent table. (This does point to the movement of my stored procedures/triggers into the BO though.)



So, what I'm hearing is no, I can't just update the current row. So, any way to refresh the data in the BO, other than calling the BO with the same fill method?
By StrataFrame Team - 12/7/2006

I don't know of a way to get the data into the other business object other than calling the Fill() method on it (except maybe the CopyDataFrom() method if you already have the data local).  However, if you are trying to tie the data in one business object to the value in the field of another business object, you might look into using the FieldPropertyChanged events on the business object.  You can turn them on for the business object by opening the properties for the business object in the BOMapper and clicking "Show Advanced Options."  Both UniqueEventForEachProperty and SingleEventForAllProperties would work for you, I think.