BO Mapper Bug on FieldChanging event when allow null

Author Message
 Posted 9/6/2016 3:28:39 AM
Advanced StrataFrame User

Advanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame User

Group: Awaiting Activation
Last Login: 3/2/2020 12:19:05 PM
Posts: 595, Visits: 3,807
I've come across a bug in BO Mapper when adding a FieldChanging event to a field that allows nulls. 
The following code was generated by the mapper. The "If value..." comparison always results to false,
since the value was set equal to the e.FieldValue in the prior line, resulting in the item always
being set to DBNull.
Set(ByVal value As System.Int32)
   Dim e As New TestBOFieldChangingEventArgs(TestBOFieldNames.ta_tst_idvalue)
   Me.OnFieldPropertyChanging(Mee)
   value = CType(e.FieldValue, System.Int32)
   If value <> CType(e.FieldValue, System.Int32Then <---- Always False
        Me.CurrentRow.Item("ta_tst_id") = value
   Else
       Me.CurrentRow.Item("ta_tst_id") = DBNull.Value
   End IfEnd Set
Since I've configured the item to be Return Alternate on Null / Set Null on Alternate to 0 
I believe the if statement should be "If value <> 0 Then" as it does when adding a FieldChanged event.
The following code was generated by the mapper for a field where Alternate on null was set to 0 with
both FieldChanged and FieldChanging events. The FieldChanged event code uses "If value <> 0" while the
FieldChanging event code is using "If value <> Ctyp..."
Set(ByVal value As System.Int32)
   Dim e As New TestBOFieldChangingEventArgs(TestBOFieldNames.ta_tst_idvalue)
   Dim llRaiseEvent As Boolean = False
   Dim loRow As DataRow = Me.CurrentRow
   Me.OnFieldPropertyChanging(Mee)
       value = CType(e.FieldValue, System.Int32)
       If value <> 0 Then
           If Not loRow.Item("ta_tst_id").Equals(valueThen llRaiseEvent = True
       Else
           If Not loRow.Item("ta_tst_id").Equals(DBNull.ValueThen llRaiseEvent = True
       End If
       If value <> CType(e.FieldValue, System.Int32Then
           loRow.Item("ta_tst_id") = value
       Else
          loRow.Item("ta_tst_id") = DBNull.Value
       End If
       If llRaiseEvent Then Me.OnFieldPropertyChanged(MeNew TestBOFieldChangedEventArgs(TestBOFieldNames.ta_tst_id))
End Set





Tags:
Post #33379
Add to Twitter Add to Facebook
 Posted 9/6/2016 3:36:41 AM
StrataFrame Developer

StrataFrame DeveloperStrataFrame DeveloperStrataFrame DeveloperStrataFrame DeveloperStrataFrame DeveloperStrataFrame DeveloperStrataFrame DeveloperStrataFrame DeveloperStrataFrame Developer

Group: StrataFrame Developers
Last Login: 5/16/2018 3:20:37 AM
Posts: 2,982, Visits: 2,482
Hrm.  Good catch, Larry.  I'll get that fixed for you.
Post #33380
Add to Twitter Add to Facebook
 Posted 9/6/2016 4:35:16 AM
StrataFrame VIP

StrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIP

Group: StrataFrame Users
Last Login: 4/9/2021 12:42:36 PM
Posts: 2,436, Visits: 24,184
Hi Ben,

Ben Chase (9/6/2016)
Hrm.  Good catch, Larry.  I'll get that fixed for you.

And for me too! Please Smile

Thanks Larry!!


Edhy Rijo
(Using VB.Net 2019/SQL Server 2017)


Edited: 9/6/2016 4:35:36 AM by Edhy Rijo
Post #33381
Add to Twitter Add to Facebook
 Posted 9/9/2016 6:31:17 AM
Advanced StrataFrame User

Advanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame User

Group: StrataFrame Users
Last Login: 7/10/2020 5:51:30 AM
Posts: 944, Visits: 40,447
Good to see a developer post. Hi Ben.

Keith Chisarik
Post #33383
Add to Twitter Add to Facebook
 Posted 10/4/2016 5:03:46 AM
Advanced StrataFrame User

Advanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame User

Group: Awaiting Activation
Last Login: 3/2/2020 12:19:05 PM
Posts: 595, Visits: 3,807
Ben,

How are you doing on that fix?

-Larry
Post #33405
Add to Twitter Add to Facebook
 Posted 10/14/2016 4:56:48 AM
Advanced StrataFrame User

Advanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame User

Group: Awaiting Activation
Last Login: 3/2/2020 12:19:05 PM
Posts: 595, Visits: 3,807
Any estimate on when a fix will be available for this? It's a pain to have to work around it with custom code.

-Larry
Post #33407
Add to Twitter Add to Facebook
 Posted 11/2/2016 3:20:30 PM
Advanced StrataFrame User

Advanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame User

Group: Awaiting Activation
Last Login: 3/2/2020 12:19:05 PM
Posts: 595, Visits: 3,807
PING!  I'd really like to have a fix for this as it is causing problems for me.

-Larry
Post #33414
Add to Twitter Add to Facebook
 Posted 11/4/2016 9:38:08 AM
Advanced StrataFrame User

Advanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame User

Group: Awaiting Activation
Last Login: 3/2/2020 12:19:05 PM
Posts: 595, Visits: 3,807
Is anyone from MicroFour monitoring the support forum??? It's been two months and this issue still exists. I wouldn't think it is that difficult of a fix to make.

-Larry
Post #33418
Add to Twitter Add to Facebook
 Posted 1/17/2017 10:28:57 AM
Advanced StrataFrame User

Advanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame User

Group: Awaiting Activation
Last Login: 3/2/2020 12:19:05 PM
Posts: 595, Visits: 3,807
Any chance this will get fixed?  It's a pain to have to maintain custom code as a work around.

-Larry
Post #33431
Add to Twitter Add to Facebook
 Posted 1/18/2017 5:47:59 AM
StrataFrame Developer

StrataFrame DeveloperStrataFrame DeveloperStrataFrame DeveloperStrataFrame DeveloperStrataFrame DeveloperStrataFrame DeveloperStrataFrame DeveloperStrataFrame DeveloperStrataFrame Developer

Group: StrataFrame Developers
Last Login: 5/16/2018 3:20:37 AM
Posts: 2,982, Visits: 2,482
Howdy Larry,

I got this fixed.  I am currently unable to do a full build because our build server is in a state of flux, but I have updated the posted release with the VISX to include this fix.  The change was made to the AddIns DLL, so that should be the only one you need to swap out.

Post #33432
Add to Twitter Add to Facebook


Similar Topics

Expand / Collapse

Reading This Topic

Expand / Collapse

Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.