Uniface User Forum

 View Only
  • 1.  beginner with struct: selecting some fields from occ

    Posted 07-22-2021 05:42

    Hi

    I'm just beginning to use struct

    moving full occurrences ok

    but I want to move to a struct  some fields of each occurence

    entity : order line and included delivery line (one to one relation)

    so I want to take for all occurrences of order line,

    order line label + delivery line quantity

    so I build struct

     l_line->$newstruct

    l_line→libelle=$newstruct

    l_line->quantity=$newstruct

    componenttostruct l_line, "orderline"   → gave me all fields

    How can I do this


    Dominique







  • 2.  RE: beginner with struct: selecting some fields from occ

    PARTNER
    Posted 07-22-2021 09:09

    To put those two fields in, it's :-



    l_line = $newstruct
    l_line→libelle = libelle.orderline
    l_line→quantity = quantity.orderline



    so a full order might look like

    l_order = $newstruct
    forentity "orderline"
      l_order->Line{$curocc("orderline")} = $newstruct
      call add_line(l_order->Line{$curocc("orderline")})
    endfor
    
    .
    .
    .
    .
    entry add_line
    params
     struct l_line : INOUT
    endparams
    
    l_line→libelle = libelle.orderline 
    l_line→quantity = quantity.orderline
    etc.
    
    end


  • 3.  RE: beginner with struct: selecting some fields from occ

    Posted 07-22-2021 16:01

    Thanks Iain

    hard to find all these in the documentation



  • 4.  RE: beginner with struct: selecting some fields from occ

    Posted 07-24-2021 07:08

    Hi Dominique,

    It could be helpful this nice page into official documentation; it is including many struct code samples.

    Gianni



  • 5.  RE: beginner with struct: selecting some fields from occ

    Posted 07-24-2021 09:57

    Thanks Gianni

    nice page