Results 1 to 3 of 3

Thread: Handle of a DDO

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2009
    Location
    Germany, Mannheim
    Posts
    427

    Default Handle of a DDO

    Hello,

    I have a problem in getting the handle of a DDO, which is NOT in the DDO-tree of the Main_File.
    Both files are completely unrelated, but I need to save records in the other file, when changes of my main_file are made.

    Data_Set and Which_Data_Set return a 0

    Are there any workarounds to solve this problem? I couldn't imgagine, that I am the only one. who has this problem.
    Regards / Viele Grüße

    Roman Köhler
    Gartenstadt-Genossenschaft Mannheim eG

  2. #2
    Join Date
    Feb 2009
    Location
    Birmingham, UK
    Posts
    1,232

    Default Re: Handle of a DDO

    There's probably a cleverer-out-the-box way, but we have the following in our DataDictionary subclass


    Code:
        // Function so that you can simply do a Broadcast Get inside a view to find a DDO that mightn't be a parent or child of the main server DDO
        Function Find_DDO Integer hFile Returns Handle
            If (hFile=Main_File(Self)) Begin
                Function_Return (Self)
            End
            Function_Return 0
        End_Function
        
        // .. or alternatively call "DDObject" of the server and let it do the work for you.
        Function DDObject Integer hFile Returns Handle
            Handle hoParent hoDDO
            
            If (hFile=Main_File(Self)) Begin
                Function_Return (Self)
            End
            Get Parent to hoParent
            Broadcast Get Find_DDO of hoParent hFile to hoDDO
            Function_Return hoDDO
        End_Function
    The second is a helper function, whereby we can simply code

    Code:
    Get DDObject of (Server(Self)) (RefTable(MyUnrelatedTable)) to hoDD
    "My wife thinks I over-analyse our marriage, which, to be frank completely contradicts the findings of my report." - @MooseAllain

  3. #3
    Join Date
    Feb 2009
    Location
    Germany, Mannheim
    Posts
    427

    Default Re: Handle of a DDO

    Thank you Peter for your quick response.

    I've tried it and it works fine.
    Regards / Viele Grüße

    Roman Köhler
    Gartenstadt-Genossenschaft Mannheim eG

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •