Bump !


As I was desperate, tried to tackle this by my own as I really needed a workaround.

Posting my current workaround here, just in case someone else hits this edge. (Parent Null , in a real FK/PK relationship defined at SQL layer) .

My DataDictionary subclass, I have implemented this:

Code:
    // *** ShouldFieldAttach *** //
    // *** Override ShouldFieldAttach for ParentNull tables *** //
    // 
    Function ShouldFieldAttach Integer iField Handle hoRelatingDD Returns Boolean
        Boolean bDoAttach bNullParentAllowed bField_Null_Allowed bIsCurrentNull
        Integer iRel
        String sVal
        
        
        // Get base funcionality 1st. 
        Forward Get ShouldFieldAttach iField hoRelatingDD to bDoAttach
        
        // Override the attachment if:
        //  a.  bDoAttach is still true 
        //  b.  IsNullParrentAllowed = True for the Parent Table. 
        //  c.  The FK column on child table (iField parameters) allow nulls 
        //  d.  The Parent is not positioned (no valid record in the buffer) 
        
        Get IsNullParentAllowed (Main_File(hoRelatingDD)) to bNullParentAllowed 
        Get_Attribute DF_FIELD_NULL_ALLOWED of (Main_File(Self)) iField to bField_Null_Allowed 


        If (bDoAttach and bNullParentAllowed and bField_Null_Allowed) Begin 
            
            // Cancel attachement if parent is cleared. 
            Move (HasRecord(hoRelatingDD)) to bDoAttach
            
            // We may be in an update, instead of a create.  and user may have removed the parent from a row that had a parent originally. 
            // in this case,  we may need to force the child related field to null. 
            If ( (HasRecord(Self)) and (not(HasRecord(hoRelatingDD))) and (OPERATION_MODE = MODE_CREATING or OPERATION_MODE = MODE_SAVING) ) Begin 
                Get_Attribute DF_FIELD_IS_NULL of (Main_File(Self)) iField to bIsCurrentNull
                If (not(bIsCurrentNull)) Set_Attribute  DF_FIELD_IS_NULL of (Main_File(Self)) iField to True
            End
            
        End
        
        Function_Return bDoAttach
    End_Function
Basically, what it does is. Detect if the column receiving the parent value (attach) allows null values. and if it does, if there is no parent record during the save/creating , it overrides the value received from regular attachment (0 if numeric column or "" if ASC), and sets it to NULL by using the DF_FIELD_IS_NULL attribute.

I am really not sure if this was the best way to "fix" it.. and also note that this is a private method.. so another negative point ...
For the record, I am still hoping that truly FK/PK with parent null environments to be supported officially by DAW in a near future.

Regards