0

Trigg 'create table' and automatic link between table

Hi all. I Have 2 linked tables 'Projet' and 'Planning'. I wanted to create a trigg record on 'Planning' when i add a new record on 'Project' and copy/paste some informations (like date, object).

I used :

let thisProjet := this;
let p := (create Planning);
let myd := 'Date de notification';
let myp := thisProjet;
p.(Jalon := "example");
Planning.('Date limite' := myd);
Planning.(Projet := myp)

It works a new record is created and information are copy/paste, but the problem is that the new record created on 'Planning' is not linked to 'Projet' automaticaly. What did i do wrong? many thx.

8 replies

null
    • Choices_Software_Dean
    • 3 yrs ago
    • Reported - view

    Try this:

     

    let key := this;
    let myd := 'Date de notification';
    let p := (create Planning);
    p.(Projet := key);
    p.(Jalon := "example");
    p.('Date limite' := myd)

    • burgundy_cup
    • 3 yrs ago
    • Reported - view

    Fantastic. Everything works perfectly. Thank you so much Dean !

    • burgundy_cup
    • 3 yrs ago
    • Reported - view

    Fantastic. Everything works perfectly. Thank you so much Dean !

    • burgundy_cup
    • 3 yrs ago
    • Reported - view

    Another configuration : I Have 2 linked tables ('Projet' with subtable 'Phases') and ('Planning'). I wanted to create a trigg record on 'Planning' when i add a new record on 'Phases' and copy/paste some informations (like date, object). Is there a way to link with 'Projet' and 'Phases'? many thx.

    • Choices_Software_Dean
    • 3 yrs ago
    • Reported - view

    Add "Trigger on create" to Phases to add new record to Planning:

     

    let p := (create Planning);
    p.(Jalon := "example2");
    p.('Date limite' := today())

    • burgundy_cup
    • 3 yrs ago
    • Reported - view

    Hi, and thanks again Master Dean, i tried this before, and the problem is that the record is created without the link with table 'Projet'.

    • Choices_Software_Dean
    • 3 yrs ago
    • Reported - view

    You could go into Edit Fields in Planning and drag over the Phases reference from right to left. I did not realize you wanted to create a reference (relation).

    • burgundy_cup
    • 3 yrs ago
    • Reported - view

    Ok thank you very much. I will try like this.

Content aside

  • 3 yrs agoLast active
  • 8Replies
  • 756Views