Why does my OnValidateFieldValue

Posts   
 
    
Posts: 26
Joined: 23-May-2005
# Posted on: 03-Nov-2006 09:10:57   

I'm using VS 2005 with LLBLGen v2.0 with two class scenario (selfservice)

I've added the following code for the validation. But if a i save my entity or when explicit validate the entity the code isn't executed. Am i missing something?

    Protected Overrides Function OnValidateFieldValue(ByVal fieldIndex As Integer, ByVal value As Object) As Boolean
      Dim toReturn As Boolean = True
      Select Case CType(fieldindex, MemberFieldIndex)
        Case MemberFieldIndex.AssociationRegistrationCode
          ' id is valid if the value is <> KEES
          toReturn = value.ToString <> "KEES"
        Case Else
          toReturn = True
      End Select
      If toReturn = False Then
        SetEntityFieldError(MemberFields.AssociationRegistrationCode.Name, "Waarde mag niet KEES zijn", False)
      End If
      Return toReturn
    End Function
Posts: 26
Joined: 23-May-2005
# Posted on: 03-Nov-2006 10:18:37   

I've downloaded the latest version and it seems to work now!

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39615
Joined: 17-Aug-2003
# Posted on: 03-Nov-2006 10:48:38   

John wrote:

I've downloaded the latest version and it seems to work now!

That's always great news simple_smile

Frans Bouma | Lead developer LLBLGen Pro