StrataFrame Forum

Change BO mode

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

By Doug Zapp - 9/20/2011

Hi,

I would like to have the ability to create a new row in a BO, save the data, continue working on the BO, then save it again.  Thus the initial save would perform an Insert, and the subsequent saves would perform an Update.  I'd rather not reset the BO and re-retrieve it, etc. 

Is there a flag on the BO to set whether the BO saves via Insert or Update?  If so, please fill in the details.

Addendum:  I should also note that my reason for this is on the second save, I'm getting a duplicate row created, or a second call to the Insert.

Thank you.

Doug Zapp
By Edhy Rijo - 9/20/2011

Hi Doug,

Please post the code you are using because the BO already works the way you are describing, you insert a record with bo.NewRow() or bo.Add, then you can bo.Save the record, modify the current record in the BO, then bo.Save as many times as you want, as long as you don't move the bo.CurrentRowIndex, you will be in the same record you added.
By Doug Zapp - 9/20/2011

I guess that is it then.  The BO is bound to a combobox, which I allow to change.  Thus prompting the change in index.

Suggestions?
By Edhy Rijo - 9/20/2011

Sorry, but I cannot clearly see the problem.  If you could post a simply VB sample using the StrataFrameSample application I would see it and help you.

Now, you said you are using a Combobox to add records? if that is the case, you want to do a save on each new record? or simply want the end user to enter as many records as they want and do a single save for each?

Like I say, it is not clear to me what you really trying to accomplish, a sample will be the best way to help you out.