Hi all,

I am upgrading a older application to DataFlex 18.1, and constrain as seems to be broken.

I am trying to fill a cDbCJGrid with a selection column to fill a different table. In my DataDictionary there are some constraints defined:

Code:
        Procedure OnConstrain
            Forward Send OnConstrain
            Constrain Relatie.Flg_Debiteur eq "J"
            Constrain Relatie.Actiefjn     eq "J"
            Constrain Relatie as (Selected(Self, Relatie.Id)=True)
        End_Procedure
In the old situation (VDF 11.1) there was a function Selected in a dbGrid wich looks at another table and returns if this specific relation is found there. This does not seem to work anymore. I moved the function to the view level, but that doesn't seem to solve the problem. My function Selected looks like this at the moment:

Code:
    
Function Selected String sRelId Returns Boolean
        
        Clear Whseldeb
        Move sRelId to Whseldeb.Klant_Id
        Move (psUserId(oDebSel_VW(Self))) to Whseldeb.User
        Find eq Whseldeb by 2
        
        If (Found) Function_Return False
        Else Function_Return True
    End_Function
It looks like the return of the function is Ok, but while filling the cDbCJGrid I get a error: Invalid data in the table buffer. Information is possibly removed by a other user or task. (or something like that, message is in Dutch).

There is no other user in my database and I am absolutely sure the data is present.

Where am I going wrong with this?

Kind regards,

Leon Raafs