Functions of Buttons
I have a table that has a button and they duplicate one of the sub tables for the next day. need a formula for this button, for duplicating all the data of the main table.
let c := (create 'GM TABLE');
let t := this;
c.(DATE := t.DATE + 1);
for i in t.AllTables do
let d := duplicate(i);
d.('GM TABLE' := c)
end;
closeRecord();
popupRecord(c)
And the second question, there are two tables, Tables1 and Tables2, with identical data. I need to create a button for deleting a record, I go to one of the tables and open the record there, there is a button that deletes this record, but I need to add a function to delete a single record in another table. Both tables subtables of one main table Table12
let result := dialog("Warning", "Are you sure?", ["Yes", "No"]);
if result = "Yes" then
alert("Deleted");
delete this
else
alert("Canceled")
end
I found this, you need to add the function of deleting a record in table2
Regards
8 replies
-
ekalcasino777 said:
need a formula for this button, for duplicating all the data of the main table.I'm not sure if c is the main table or is t the main table? If it is t then.
Try:
for i in t.AllTables do let d := duplicate(i); d.('GM TABLE' := c; field2 := t.field2; field3 := t.field3; etc...)
ekalcasino777 said:
I need to create a button for deleting a record, I go to one of the tables and open the record there, there is a button that deletes this record, but I need to add a function to delete a single record in another table. Both tables subtables of one main table Table12How is the record in table 1 linked to a record in table 2 besides Table12? If you are in Table1 and you do a search in Table2 for all records that linked to Table12 you will get multiple records so there must be another field that links the record in Table1 and the record in Table2 that you want to delete.
-
Fred said:
How is the record in table 1 linked to a record in table 2 besides Table12? If you are in Table1 and you do a search in Table2 for all records that linked to Table12 you will get multiple records so there must be another field that links the record in Table1 and the record in Table2 that you want to delete.They are not related to each other, to create a record in these tables, I use a button that automatically creates records in both tables at the same time. the name of these tables alltables and alltables2
Thanks for help Fred
-
Is there some other data that links them like a date field or something else?
-
Your buttons say "Create Table" and "Delete Table" do you mean records?
What fields are in Table1 and Table2?
What fields are in GM Table?
Can you post a sample db?
Content aside
- 2 yrs agoLast active
- 8Replies
- 182Views
-
2
Following