Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Duplicated Broken Rules Message at bottom page?
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
MS SQL Server
Miscellaneous
Thread ID:
01175129
Message ID:
01177060
Views:
8
Liew,

>Even I have done the child obj registration, it will just show the warning message in the last tab where the user saves the record, but I would prefer to display the warning message for the invalid entry in the respective tab. So the validation will be done for each tab when the tab index is changed. Currently I'm using the following function for my validations. Is there a better way to do so? Thanks.
>
>
>            saveResult = Me.oAddress.Rules.CheckRules(Me.oAddress.DataSet, Me.oAddress.TableName, True)
>
>            Select Case saveResult
>                Case mmSaveDataResult.RulesPassed
>                    Return True
>                Case mmSaveDataResult.Exception
>                    ' Do something
>                    Return False
>                Case Else
>                    ' Do something
>                    Return False
>             End Select
>
Yes, there is a better way. If you call CheckRules() directly on the business object, it will automatically call CheckRules() on all child business objects and bubble all errors up to the parent business object. However, the mmBusinessObject.CheckRules() method is protected, so you need to create a public wrapper method on ABusinessObject in order to call this method directly. For example:
Public Function CallCheckRules() As mmSaveDataResult
    Return Me.CheckRules(Me, Me.DataSet, Me.TableName)
End Function
Best Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform