0

Hide button if selection in Multiple Choice

I need to make the button "ESENZIONE BOLLA" appear only if the flag is active on DAF FF 058 PS 2600KG in the dynamic multiple choice field. Otherwise I need to hide it.

How I have to write the formula??

10 replies

null
    • Mel_Charles
    • 1 yr ago
    • Reported - view

    in the display if  section on the button put something like

    MCF = "2" or MCF = "3"

    note replace MCF with the name of your multiple choice field

    This will show the button if either are selected

    you don't say if if it is either option or if both selected

    so you may need to fiddle with the script

    the numbers are the internal position of the choice field

      • thomas.4
      • 1 yr ago
      • Reported - view

      Mel Charles I tried as you said but the button does not appear if I select the first box. Since the part with the boxes to check is a dynamic multiple choice field , I don't have internal placement numbers. I have the numbers only if I go to the table to which it refers. Unfortunately it doesn't work with your formula though

      • Mel_Charles
      • 1 yr ago
      • Reported - view

      thomas ah- I had assumed you were using normal choice field 

    • Fred
    • 1 yr ago
    • Reported - view

    Just to be clear, are you talking about a regular multiple choice for a dynamic multiple choice?

      • thomas.4
      • 1 yr ago
      • Reported - view

      Fred Sorry it's a dynamic multiple choice field.

    • Fred
    • 1 yr ago
    • Reported - view
    thomas said:
    it's a dynamic multiple choice field

     then you can try something like:

    let x := for loop1 in numbers(dMCfield) do
            record(dMC-tableName,loop1)
        end;
    count(x[fieldName = "DAF FF 058 PS 2600KG"]) > 0
    

    Lines 1 - 3, here is where we use the for loop to go through the dMC selections and then use the record() function to get the record data from the table that the dMC is based on.

    Line 4 then checks the new array of records for the specific value of a field that you use to display in the dMC and if the count of records return is greater than 0 then display.

      • thomas.4
      • 1 yr ago
      • Reported - view

      Fred Thank you! But what if the name DAF FF 058 PS 2600 KG in the dmc, referenced to the table AUTOCARRO is composed using this formula?

      Marca + "
      " + Targa + "
      " + Portata + "
      " + " " + "
      "

    • Fred
    • 1 yr ago
    • Reported - view
    thomas said:
    But what if the name DAF FF 058 PS 2600 KG in the dmc, referenced to the table AUTOCARRO is composed using this formula

     Just treat it like a normal filter:

    let x := for loop1 in numbers(dMCfield) do
            record(dMC-tableName,loop1)
        end;
    count(x[Marca = XXX and Targa = XXX and Portata = XXX]) > 0
    

    That is benefit of using records. You have access to all of the data. Though I guess it could slow things down if things are too big, but that is another discussion.

      • thomas.4
      • 1 yr ago
      • Reported - view

      Fred Thank you! I used this formula. I changed the last line and now it works perfectly

    • Ninox partner
    • RoSoft_Steven.1
    • 1 yr ago
    • Reported - view

    thomas if you know which record ID your DAF FF 058 PS 2600KG is on, you can use this formula in the display only section of the button:

    contains(numbers('Mezzi pesanti'), 2)

    In this example the 2 = the record of the wanted selection...

Content aside

  • Status Answered
  • 1 yr agoLast active
  • 10Replies
  • 115Views
  • 4 Following