0

Copy and open new record

for duplicate last record im us formula

    let x := dialog("NEW DAY TEMPLATE", "Do you want create template for a next day?", ["No", "Yes"]);
if x = "Yes" then
    let c := duplicate(this);
    let t := this;
    c.(DATE := t.DATE + 1)
end
 

But I need to open created records after click on this button, and I extend this formula 
    closeRecord();
    popupRecord(c)
end

Get result 

Somebody can explain what happens?

Thanx 

2 replies

null
    • Fred
    • 2 yrs ago
    • Reported - view

    You don't need to close the current record. Just put the openRecord command inside the if statement:

        let x := dialog("NEW DAY TEMPLATE", "Do you want create template for a next day?", ["No", "Yes"]);
    if x = "Yes" then
        let c := duplicate(this);
        let t := this;
        c.(DATE := t.DATE + 1)
        openRecord(c)
    end
    
      • iliper LTD
      • iliper_LTD
      • 2 yrs ago
      • Reported - view

      Fred just one think

      let x := dialog("NEW DAY TEMPLATE", "Do you want create template for a next day?", ["No", "Yes"]);
      if x = "Yes" then
          let c := duplicate(this);
          let t := this;
          c.(DATE := t.DATE + 1);
          openRecord(c)
      end

      Thanks Fred