0

copy part of a table on a new subtable

hello 

hello
I have a table with patients and it has become very large and I am trying to create a subtable to better organize data. But from those that I already have saved, I want to copy the variables already stored in the new subtable. 
I have this code that I'm testing:

let subRecord := (create Cirugias);
subRecord.(Pacientes := this);
subRecord.('Fecha de Ingreso' := this.'Fecha de Ingreso');
subRecord.('Fecha de cirugia' := this.'Fecha de cirugia');
subRecord.(FechaAlta := this.FechaAlta);
subRecord.('Requirio CTI' := this.'Requirio CTI');
subRecord.('Fecha Ingreso CTI' := this.'Fecha Ingreso CTI')

 

This effectively copies the variables but does not assign them to the "patient" although both tables are related.

I also tried this code but I didn't have any success either:

 

for p in select Pacientes do
    let subRecord := (create Cirugias);
    subRecord.(Pacientes := p);
    subRecord.('Fecha de Ingreso' := p.'Fecha de Ingreso');
    subRecord.('Fecha de cirugia' := p.'Fecha de cirugia');
    subRecord.(FechaAlta := p.FechaAlta);
    subRecord.('Requirio CTI' := p.'Requirio CTI');
    subRecord.('Fecha Ingreso CTI' := p.'Fecha Ingreso CTI')
end

 

please i need your help 

Leo Toscano

3 replies

null
    • Fred
    • 12 days ago
    • Reported - view

    If Pacientes is name of the reference field in Cirugias then linking them in with the loop variable should work. I know something using ‘this’ directly doesn’t work so you have to put ‘this’ in a variable then use it later in your code.

    Can you post a sample DB?

      • Cirugia_Toracica
      • 2 days ago
      • Reported - view

       i partially solve that issue adding a button to the main table (pacientes) and i copied and created field in Cirugias (related table to pacientes). 

      But i was not able to copy an specific field value without creating a new field. 

      • Fred
      • 2 days ago
      • Reported - view

       I’m not sure what you mean by:

       said:
      not able to copy an specific field value without creating a new field.

      Can you post a sample DB? 

Content aside

  • 2 days agoLast active
  • 3Replies
  • 22Views
  • 2 Following