Choice field repeat the value of the previous day
There is a Choice field where there are several options. When creating a new record, i need the value of this Choice field to transfer to the next day. Please advise the formula
20 replies
-
Just add the name of the field and make it equal to the same name field:
let t := this; let newRec := (create Table2); newRec.( MultiChoice := t.MultiChoice; Country := t.Country )
MultiChoice is a simple multiple choice field.
Country is a dynamic choice field.
-
said:
I created a button outside the table to create a new record and then in the table, but it didn’t work.Create the button in the table that has the Category field, which I guess is Daily Result?
Try not to do too many select statements in Ninox:
let c := number(Id); let bc := last((select 'CASH DESK' where number(Id) < c) order by number(Id)); first(select 'CASH DESK' where Id = bc).'CLOSE 1'
You have a select statement in lines 2 and 3.
From my reading of it you don't need the line 3 select since you are referring to the record you found in line 2. So you can rewrite line 3:
let c := number(Id); let bc := last((select 'CASH DESK' where number(Id) < c) order by number(Id)); bc.'CLOSE 1'
-
This is so that you can track changes in client category, without going into the table.
Well then you just need to figure out which record you need to pull the data from. If you order 'Daily Result' by Date, do you need the last record? If so then you can change the code to:
let t := last('Daily Result' order by Date); let newRec := (create 'Daily Result'); newRec.( Category:= t.Category; )
this would go in a button at the parent table of Daily Result.
-
I forgot to add the part of linking it to the parent record.
let t := this; let oldData := last('Daily Result' order by Date); let newRec := (create 'Daily Result'); newRec.( ParentRecordFieldName := t; Category:= oldData.Category; )
If you look at the Daily Result table you will see the new records there just not linked to the parent record.
-
said:
Fred I saw it, but didn’t understand how to do it ) Parent Record - what should I write there?You show a screenshot of a record that has the 'Daily Result' table in it. In the 'Daily Result' table there is a reference field name that points to this table put name of the reference field in Daily Result.
Content aside
- Status Answered
- 1 yr agoLast active
- 20Replies
- 85Views
-
2
Following