An answer not a question on validation RRS feed

  • Question

  • One of the nice things about lightswitch is that it can validate at several levels. The client side is picky and change listener validation requires a change (duh)....

    On the server side there are two great spots. One is on the field itself extended validation. However this one is missing on any foreign key related table. There is a server validation available! Click on the field in designer and select the foreign key validation typically the last entry in the top list. Add the code to see if the object exists. Send message. Done.

    Never saw this example anywhere but it is sort of obvious.

     Private Sub HWSRCSR_Validate(results As EntityValidationResultsBuilder)
                ' results.AddPropertyError("<Error-Message>")
                If (HWSRCSR Is Nothing) Then
                    results.AddPropertyError("Please Enter the CSR, it cannot be blank!")
                End If
            End Sub

    Thursday, September 17, 2015 4:00 PM