BO not getting Dirty...


Author
Message
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Let me clarify this a bit more:

In the parent form I have the following BOs:



bizInventory1 -> Parent

bizInventoryItems1 -> Child



These BOs are translated via a ChildDialog into a child form which have the following BOs:



bizInventory1 -> Parent

bizInventoryItems1 -> Child

bizInventoryItemsForListView -> This is the same type of the child BO bizInventoryItems1, all new records are added to this bo and when done, the records are copied to the bizInventoryItems1, the form is close and in the parent form the bizInventoryItems1 has all records added in the child form, but the bizInventoryItems1.IsDirty is False and when I try to save the data, the child records are not saved.





I am doing it this way because in the parent form the child bo bizInventoryItems1 may have previous records that I do not want to be shown in the child form when adding more records. I tried calling the Let me clarify this a bit more:

In the parent form I have the following BOs:



bizInventory1 -> Parent

bizInventoryItems1 -> Child



These BOs are translated via a ChildDialog into a child form which have the following BOs:



bizInventory1 -> Parent

bizInventoryItems1 -> Child

bizInventoryItemsForListView -> This is the same type of the child BO bizInventoryItems1, all new records are added to this bo and when done, the records are copied to the bizInventoryItems1, the form is close and in the parent form the bizInventoryItems1 has all records added in the child form, but the bizInventoryItems1.IsDirty is False and when I try to save the data, the child records are not saved.





I am doing it this way because in the parent form the child bo bizInventoryItems1 may have previous records that I do not want to be shown in the child form when adding more records.

.Edit() in the listview.ChildFormResults() but did not made a difference, any of the new added records are never saved to the database.



Any other idea where I may start looking?


Edhy Rijo

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
If you set this same BO on the parent form, does it become dirty (in other words not translated)?  I bet it will which means that the actual reference object that you are dealing with is probably the one on the child form not the reference of the one on the parent.  You may want to put a debug in the OnLoad after the MyBase.OnLoad() is called and see if they are the same reference object...that would be the first place I would look so I could at least determine if this is my issue.
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
I have a form with 2 BO Parent and Child, I have done this many time using a ChildFormDialog, what have changed in this case is that in the ChildForm I need to add many records at the same time, not just one as usual in a ChildFormDialog situation. So I have done is in the child form I added another instance of the child BO and add all the records there, then I use the BO.CopyFrom to update the translated child BO, but at this stage the translated child bo does not get dirty, so when saving, all those records are not saved.



This is the code in the "OK" commandbutton of the child form:



Private Sub cmdOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdOK.Click

Me.BizInventoryItems1.Filter = ""

Me.BizInventoryItems1.CopyDataFrom(Me.BizInventoryItemsForListView, MicroFour.StrataFrame.Business.BusinessCloneDataType.AppendDataToTableFromDefaultView)



DialogResult = Windows.Forms.DialogResult.OK

End Sub




What am I missing here that will not set the me.BizInventoryItems1 bo dirty so it can be properly saved at the parent form?

Edhy Rijo

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search