0

create a new record in subtable

Hello,
I have an invoice table and a sub-table for the invoice items. I'd like with a button to reproduce the same behavior as when I create a new item when I'm on a record of the sub-table. Currently I can create a new element, but I can not position myself on the new element while the button of the graphical interface happens to position itself on the new record to create.

Thank you in advance for your assistance.
Robert

8 replies

null
    • Leonid_Semik
    • 6 yrs ago
    • Reported - view

    Hi Robert,

    ---

    let myID:=Id;

    let newSUB:=create Subtable;

    newSUB.'invoice table':=myID

    popupRecord(record(Subtable, number(newSUB.Id)))

    ---

    regards

    Leo

    • CISOFT_Sarl
    • 6 yrs ago
    • Reported - view

    Hello Leo,

    Thanks for your response, but i need create a new item from subtable. In your code you are on invoice table for creating the items element.

    I need create a new item when i'm on subtable.

     

    Thanks

    Robert

    • Leonid_Semik
    • 6 yrs ago
    • Reported - view

    Ok, then:

    ---

    let myID:='invoice table';

    let newSUB:=create Subtable;

    newSUB.'invoice table':=myID

    popupRecord(record(Subtable, number(newSUB.Id)))

    ---

     

    Leo

    • CISOFT_Sarl
    • 6 yrs ago
    • Reported - view

    Ok, but it popup a new record in subtable.

    When i'm on the subtable, if a a create a new item with the button of UI on the top it create new and it's ready to use, but with my code or your code, it make same but it popup a new form for the new item.

    You understand me? or send a picture?

    • Birger_H
    • 6 yrs ago
    • Reported - view

    To open the record just change the code like this:

    –––

    let myID:='invoice table';

    let newSUB:=create Subtable;

    newSUB.'invoice table':=myID

    openRecord(record(Subtable, number(newSUB.Id)))

    –––

    • saffron_bear
    • 1 yr ago
    • Reported - view

    Even though this entry is very old: I also have the need to create a subtable record.


    "let myID:=Id;" will not work for me, i get the error "A table column was not found: Id". What I'm doing wrong?

    Thanks, Stefan

      • Leonid_Semik
      • 1 yr ago
      • Reported - view

       try this:

       

      let myId:=_id

      • saffron_bear
      • 1 yr ago
      • Reported - view

      works - best thanks

Content aside

  • 1 yr agoLast active
  • 8Replies
  • 3463Views
  • 2 Following