0

Move record.

Is it possible to move a record to another table depending on a selection field ie yes.  And remove from original table. 

Thank you. 

6 replies

null
    • Choices_Software_Dean
    • 3 yrs ago
    • Reported - view

    Alan, Create a new database with two tables named: Table1 and Table2. Include two text fields named: firstname and lastname (in both tables). Add a 'Yes / No' field with the default name to Table1. Create sample records in Table 1. Select "Yes" in one or more of the records. Then add the following code to a "Move Records" button in Table1:

    for i in select Table1 where 'Yes / No' = true do
      let k := i.this;
      let f := i.firstname;
      let l := i.lastname;
      delete (select Table1 where Id = k);
      let t := (create Table2);
      t.(firstname := f);
      t.(lastname := l)
    end

    • Karen_Estrada
    • 3 yrs ago
    • Reported - view

    Glad Alan asked the question, was wondering the same. THANK YOU Dean (for your answer !! :-))

    • Faldo
    • 3 yrs ago
    • Reported - view

    Thanks Dean will try that today.  I was going down the rout of another view or filter or something but that sounds great 

    Karen great to think there's more than me scratching our heads. 😂😂

    • Faldo
    • 3 yrs ago
    • Reported - view

    Wow just tried it and brilliant thanks again Dean

    • Choices_Software_Dean
    • 3 yrs ago
    • Reported - view

    If you want user to end up viewing destination table, you could add two more lines:

     

    openTable("Table2");
    alert("Records with ""Yes"" have been moved to Table2")

    • Faldo
    • 3 yrs ago
    • Reported - view

    Brillaint keep them coming :0

Content aside

  • 3 yrs agoLast active
  • 6Replies
  • 504Views