Broken Rules


Author
Message
Tim Dol
Tim Dol
StrataFrame User (434 reputation)StrataFrame User (434 reputation)StrataFrame User (434 reputation)StrataFrame User (434 reputation)StrataFrame User (434 reputation)StrataFrame User (434 reputation)StrataFrame User (434 reputation)StrataFrame User (434 reputation)StrataFrame User (434 reputation)
Group: Forum Members
Posts: 340, Visits: 1.4K
Is there a way to turn off checking broken rules (not at the form level).  I turned off CheckCurrentRowBeforeNavigate but it didn't seem to have any effect.  I can certainly create a property in the business object for this but wanted to know if something already existed.

Thanks

Tim

Dustin Taylor
Dustin Taylor
StrataFrame Team Member (660 reputation)
Group: StrataFrame Users
Posts: 364, Visits: 771
The easiest way I can think of is to set the IgnoreRuesAndForceSave to True on the business objec'ts BusinessRulesChecked event. So on the business object itself:

Private Sub MyBO_BusinessRulesChecked(ByVal e As MicroFour.StrataFrame.Business.BusinessRulesCheckedEventArgs) Handles Me.BusinessRulesChecked
   e.IgnoreRulesAndForceSave = True
End Sub

Hope it helps Smile

Dustin Taylor
Dustin Taylor
StrataFrame Team Member (660 reputation)
Group: StrataFrame Users
Posts: 364, Visits: 771
Trent mentioned another good idea: add a custom property on the business object (or base busines object) to identify whether or not to ignore the rules, and override the OnCheckRulesOnCurrentRow event to test for that property:

'-- This is set by the custom property below

Private _IgnoreRules As Boolean = False
 
''' <summary>
''' Gets or sets _IgnoreRules
''' </summary>
Public Property IgnoreRules() As Boolean
    Get
        Return Me._IgnoreRules
    End Get
    Set(ByVal value As Boolean)
        Me._IgnoreRules = value
    End Set
End Property
 
Protected Overrides Sub OnCheckRulesOnCurrentRow(ByVal e As MicroFour.StrataFrame.Business.CheckRulesEventArgs)
    '-- Only check the rules if _IgnoreRules is False

    If Not _IgnoreRules Then MyBase.OnCheckRulesOnCurrentRow(e)
End Sub

Probably the slickest way to go about what you are trying to do BigGrin

Tim Dol
Tim Dol
StrataFrame User (434 reputation)StrataFrame User (434 reputation)StrataFrame User (434 reputation)StrataFrame User (434 reputation)StrataFrame User (434 reputation)StrataFrame User (434 reputation)StrataFrame User (434 reputation)StrataFrame User (434 reputation)StrataFrame User (434 reputation)
Group: Forum Members
Posts: 340, Visits: 1.4K
Perfect. Thank you very much!
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