0

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

null
    • Digital Sonar
    • Alexandros_Finomenos
    • 1 yr ago
    • Reported - view

    [Ordered = true] add this on your auto number query

    • New_Sun
    • 1 yr ago
    • Reported - view

    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
    end

     

    Where should I put the [Ordered=true]?

    • Fred
    • 1 yr ago
    • Reported - view

    Is Ordered the name of a choice field or is it a Yes/No field?

    or

    Is Ordered a choice in a choice field?

    • New_Sun
    • 1 yr ago
    • Reported - view

    "Ordered" is a choice field

    • Fred
    • 1 yr ago
    • Reported - view

    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.

    • New_Sun
    • 1 yr ago
    • Reported - view

    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.

    • Fred
    • 1 yr ago
    • Reported - view
    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 two

    The 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?

      • New_Sun
      • 1 yr ago
      • Reported - view

      I just want the row number to be done back to back when I select the order

Content aside

  • 1 yr agoLast active
  • 8Replies
  • 131Views
  • 3 Following