BeforeSave event not firing in 1.6.6
 
Home My Account Forum Try It! Buy It!
About Contact Us Site Map
StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



BeforeSave event not firing in 1.6.6Expand / Collapse
Author
Message
Posted 04/30/2008 10:06:27 AM
StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: 05/08/2008 4:00:06 PM
Posts: 69, Visits: 249
I have some code in the beforesave event of one of my business objects. I've verified the handler is still connected. When I set a break point and fire a save on this business object, the code in event handler is not firing. Any ideas?
Post #16020
Posted 04/30/2008 10:15:58 AM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: Yesterday @ 9:46:15 PM
Posts: 288, Visits: 1,135
Hi Randy,

Make sure the Business Object property IncludeInFormSave is set to True for that BO.

In case that does not work, please provide more detail info like this:

  • What version of the SF Assemblies are you using?
  • How many BO are you using in this form?
  • Is the mentioned BO a Parent or a Child BO?


Edhy Rijo
Progytech (Computer Consultants)
Post #16024
Posted 04/30/2008 10:19:33 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 3:24:00 PM
Posts: 3,733, Visits: 3,926
Edhy's questions are valid, but it appears that the handler isn't attached or the BO is not being saved.  I just setup a test and it works as it should, so let's start digging through your environment.
Post #16025
Posted 04/30/2008 2:02:52 PM
StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: 05/08/2008 4:00:06 PM
Posts: 69, Visits: 249
IncludeInFormSave is true. This actually the main BO on an SF Wizard Form. In the Finish_Clicked i'm just calling me.save() - this BO is set as my PrimaryBusinessObject as well. It is the parent.

The handler is connected. In the properties I see the method is linked and when I double click it take me to that code which has Handles MyBase.BeforeSave.


Private Sub DCASetupDataBO_BeforeSave(ByVal e As MicroFour.StrataFrame.Data.BeforeSaveUndoEventArgs) Handles MyBase.BeforeSave
Dim nNumberOfSolutions As Integer = 0
If Me.SolutionLevel1 <> Guid.Empty Then
nNumberOfSolutions = nNumberOfSolutions + 1
End If
If Me.SolutionLevel2 <> Guid.Empty Then
nNumberOfSolutions = nNumberOfSolutions + 1
End If
If Me.SolutionLevel3 <> Guid.Empty Then
nNumberOfSolutions = nNumberOfSolutions + 1
End If
Me.NumberSolutions = nNumberOfSolutions
End Sub


Just updated to 1.6.6 - everything builds fine and this was working prior to the update so not sure what could be going on.

File versions are showing 1.6.5.1 on all assemblies in Strataframe version dialog.

Thanks,
Randy





Post #16037
Posted 04/30/2008 2:23:11 PM
StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: 05/08/2008 4:00:06 PM
Posts: 69, Visits: 249
I forgot to mention there are other BOs but they are not getting updated by the form so I set them all to be IncludeInFormSave = false

Still no go. I know the save is firing because my checkrulesoncurrentrow is firing which is telling me that my numberofsolutions is required. Hmm... maybe this event fires before the beforesave event now...
Post #16038
Posted 04/30/2008 2:57:00 PM
StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: 05/08/2008 4:00:06 PM
Posts: 69, Visits: 249
Yep, looks like that is what is happening. Checkrulesoncurrentrow in the bizobj is firing before any of the beforesave events, which sort of makes sense I suppose from a logical standpoint. Knowing this I think I can probably find a workaround. Not using beforesave in too many places.
Post #16039
Posted 04/30/2008 5:26:10 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 3:24:00 PM
Posts: 3,733, Visits: 3,926
Use the BusinessRulesChecked event.  This will get fired every time and allow you to override any broken rules (if you have that need).  But it will always fire pre-save whether there are broken rules or not.
Post #16051
Posted 04/30/2008 6:00:04 PM
StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: 05/08/2008 4:00:06 PM
Posts: 69, Visits: 249
Thanks, I'll give this a try.
Post #16056
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse