Public Overridable Function InitializeWithRow() As Boolean Return True End FunctionThe client class, optionally, can use it if necessary like this:
Public Overrides Function InitializeWithRow() As Boolean ' Put something in here Return True End FunctionIn that particular framework overridable method design, if the DataEntry framework class has a primary key, I need to validate a few things in the framework class before allowing the call to the cilent class. So, this goes like this:
' The following could be a simple call to InitializeWithRow() as this is an overridable method. However, ' because InitializeWithRow() should be used only when we have a primary, thus oRow would be available, ' we are using it like that to verify first if the method exists in the client class. If yes, we verify ' first to see if we have a primary key. If yes, we continue with the call to the method. Otherwise, ' we redirect the user to the domain as this means the user manipulated the URL by removing the Session ' or the primary key. ' If the method exists in the client class If loReflection.IsMethodExistInSubClass(Me, "InitializeWithRow") Then ' If we have a primary key If nPrimaryKey > 0 Then ' Initialization code with row If Not InitializeWithRow() Then Return False End If Else ' If the primary key is mandatory If lPrimaryKeyIsMandatory Then ' If we are using an ID on entry to locate a record on the table but we are adding If lSwitchFromUpdateToAdd Then Else oProcess.RedirectMain(oProcess.cHttp) End If End If End If End If