Here's a fun one. I load a webgrid from a DDO that has this...

Code:
Procedure OnConstrain
    Constrain RPTFILTR.DELETED EQ 0
End_Procedure
This works great for suppressing "deleted" records from the grid, without actually deleting the records.

The problem is that when the view's OnBeforeShow event checks for missing RPTFILTR records, so it can add any new filters (from a filter library), there's an exact-match find on RPTFILTR K1, and then conditional logic to create a record only if a record was (Not(Found)).

The trouble seems to be that the DDO constraint reacts to (RPTFILTR.DELETED = 1) as if the record was simply not found. It was found, but the constraint wasn't met. So it tries to create a record and I get a dupe-record error (28).

Looking for a way out of the Catch-22. Any suggestions?

All the best,
Nick