• Dataflex
  • Postgresql
  • Windows
  • Wordpress
data dictionaries

DataFlex - Clear a data dictionary but keep its parents

Overview

Often you find yourself creating a collection of child records, but you want them all to have the same parents.

If you only have one parent, then doing Set Constrain_File to Parent.file_number will ensure the parent isn’t cleared, but then other parents are still cleared and you can only have one contrain file.

Sourced from DataFlex forums.

Code

Procedure Clear_Retain_Parents
    // The standard Clear message also clears (non-Constrained) server DDOs.
    // This does not.
    Handle hoServer
    Handle[] hoServerList   // the object ids of all this DDO's servers
    Integer iCount iMax
    Get Data_Set_Server_Count to iMax
    Decrement iMax
    For iCount from 0 to iMax
        Get Data_Set_Server 0 to hoServer
        Move hoServer to hoServerList[iCount]
        Send Detach_Server hoServer
    Loop
    Send Clear
    For iCount from 0 to iMax
        Move hoServerList[iCount] to hoServer
        Send Attach_Server hoServer
    Loop
End_Procedure
Get In Touch

Why partner with Digitize?

At Digitize, we are a focused team that invest constantly in improving so that we can provide the best capabilities to our clients. Our processes and teams are built around being flexible so we can deliver tailored solutions instead of trying to make existing solutions fit.

Each client has a dedicated account manager that will ensure you are always getting the best service possible.