0

How to duplicate a record with reference to the original one?

I am using a button-script like this

let d := duplicate(this);
d.(“Yes / No” := false);
d.(Customer := 0);
popupRecord(d)

This duplicates the record and empties the fields: “Yes / No” and Customer. Αll other fields will be cloned.

My question: how can I include the following function: I want the duplicate record automatically contain a reference to the original record where it was copied from. For thsi I already created  a“Link to” field. How to formulate this as part of the button script?

Best regards  Robert

5 replies

null
    • Alain_Fontaine
    • 3 yrs ago
    • Reported - view

    let me := this;

    d.(“Link to” := me)

    • robert.1
    • 3 yrs ago
    • Reported - view

    Bello Alain, thanks  for quick reponse. It works like a charm!

    • Rijard
    • 2 yrs ago
    • Reported - view

    Robert, what type of field was the "Link to" field?

    Regards, Rijard

    • robert.1
    • 2 yrs ago
    • Reported - view

    Hello Rijard, this is a reference field to the same table. See screenshot. Hope this helps!

    • robert.1
    • 2 yrs ago
    • Reported - view

Content aside

  • 2 yrs agoLast active
  • 5Replies
  • 694Views