0

How do I create child records in a subtable?

I have a table Student with a subtable Lesson. I'm in a particular Student record, how do I programmatically create a new linked Lesson record which I can set date and time fields?

5 replies

null
    • Leonid_Semik
    • 5 yrs ago
    • Reported - view

    As a Formula in a Button in the Table 'Student':

    ---

    let myID := Id;
    let myL := create Lesson;
    myL.Student := myID;
    popupRecord(record(Lesson,number(myL.Id)))

    ----

    Leo

    • Paul
    • 5 yrs ago
    • Reported - view

    Thanks Leo. Works!

    • Manu_Kast
    • 4 yrs ago
    • Reported - view

    Hi Leo and Paul,

     

    I tried everything but I don't know, what I missed out?! Enviornment iPad

    let myMainID := Id;
    let mySubRec := create Lagerebene;
    mySubRec.(Lagerplatz := myMainID);

    The same happens, when I use "Bezeichnung" as a reference for my main table data enty.88F96D7E-FEDD-4123-882C-9AD175C88063

    • Manu_Kast
    • 4 yrs ago
    • Reported - view

    Ich habe die Lösung gefunden. Es scheint this zu sein

    let myMainID := this;
    let myAnzahl := Anzahl;
    for i in range(1, myAnzahl + 1) do
    let mySubRec := (create Lagerebene);
    mySubRec.(Lagerplatz := myMainID);
    mySubRec.(Ebenennummer := i)
    end

    • University of Ibadan
    • Dapo_Omoiyadapo
    • 3 yrs ago
    • Reported - view

    Hello,

    Can I use a For loop structure? Will it work correctly with embedded create record function? I'm a university professor (University of Ibadan) and need to create Student records at once.

    One possible method> Limit number of records in a subtable of essaytyper

Content aside

  • 3 yrs agoLast active
  • 5Replies
  • 2252Views