Auto Number by ComboBox
Hi
in my item invoice, I have an auto number and it is good.
in the table of "Invoice items," I have one comboBox that I have filed with "Ordered". I need when I choose the "Ordered" auto number to calculate only "Ordered"
8 replies
-
[Ordered = true] add this on your auto number query
-
I have this formula in my table in "Invoice Items"
let myID := number(Id);
let myInvoice := Invoice;
if Invoice then
cnt((select 'Invoice Item')[Invoice = myInvoice and number(Id) <= myID])
else
0
endWhere should I put the [Ordered=true]?
-
Is Ordered the name of a choice field or is it a Yes/No field?
or
Is Ordered a choice in a choice field?
-
"Ordered" is a choice field
-
Since you already have an if statement I like to use a switch above it so it looks cleaner. I get lost when there are too many nested if statements.
You said Ordered is a choice field. But after re-reading the original post it sounds like Ordered is an option in a choice field.
You can try something like:
let myID := number(Id); let myInvoice := Invoice; switch text(choicefield) do case "Ordered": if Invoice then cnt((select 'Invoice Item')[Invoice = myInvoice and number(Id) <= myID]) else 0 end end
You can check out this post for more info about switch statements.
-
thank you fred;
but there is one problem, Suppose there are two fields in the Combobox, one for "ordered" and the other for "cancel". We have ten items listed in order from number one to ten. Suppose I cancel the second-row number. In your formula, the number of the second row is empty, but the number of the third row, which is "ordered", starts from number three, not from number two
While I canceled the number of the second row, the number of the next row, which is "ordered", should show the number two, but it shows the number three.
-
New Sun said:
Suppose I cancel the second-row number. In your formula, the number of the second row is empty,Isn't that how you wanted it?
New Sun said:
Suppose I cancel the second-row number. In your formula, the number of the second row is empty, but the number of the third row, which is "ordered", starts from number three, not from number twoThe way you described your work flow it made it sound like this was a one time action. Now are you asking for the number to be ordered?
Content aside
- 2 yrs agoLast active
- 8Replies
- 133Views
-
3
Following